git base commond

打开Git Bash
命令:先写 git status, 它会告诉你怎么做
1. git pull  (把git库中代码拉下来)
    
2. $ git status (查看状态)
3. $ git add *   (git add /templates/*){git checkout 恢复没提交的修改}
4. git commit  -m 描述内容
5. git push origin master
---------------
将文件放在git的那个文件夹内(你的那个是www文件夹)
git add 指定文件地址
git commit -m 我是描述
git push origin master
----
git pull
git commit -m "first commit"
git remote add origin git@github.com:teamtogeth push -u origin master
有冲突
 
1. git pull  (把git库中代码拉下来)   
  

如果希望保留生产服务器上所做的改动,仅仅并入新配置项, 处理方法如下:

a. git stash
b. git pull
c. git stash pop

然后可以使用Git diff -w +文件名 来确认代码自动合并的情况.

反过来,如果希望用代码库中的文件完全覆盖本地工作版本. 方法如下:

git reset --hard
git pull

其中git reset是针对版本,如果想针对文件回退本地修改,使用

------------------------------------------------
git clone
git clone path
 
---------------------------------
 
往传代码:
------在git 输入-----
ssh root@ip地址
password
 
git checkout(可以不写 gitcheckout 是删除修改)
 
-------------
git pull      //git的代码 下载测试服务器
-------------------------------------------
$ git branch    查看分支
 
$ git branch -r
 
# find -maxdepth 100 -name 'main'
# find -maxdepth 100 -name 'main.php'
ls
vim ./wxshop/templates/default/main.php  //
 
# git branch
 
git checkout master
 
 
# rm -rf data/upload/wechat/qr_img/2196/
# git status
---------------------------------------
遇到冲突  git diff 
git status
 
git pull
Auto-merging wxshop/control/weixin.php
CONFLICT (content): Merge conflict in wxshop/control/weixin.php
Automatic merge failed; fix conflicts and then commit the result.
git diff  wxshop/control/weixin.php
 
找到冲突地方 修改 重新提交
原文地址:https://www.cnblogs.com/zyjzz/p/6561876.html