Git的主要的操作

git的主要的配置:

1、git config --global core.autocrlf true

2、git config --global core.longpaths true(解决文件路径太长的问题)

3、git config --global credential.helper store(设置免输密码)

4、git remote -v (origin实际上就代表一个url)

origin https://github.com/user1/myRepository.git (fetch)

origin https://github.com/user1/myRepository.git (push)

5、 git fetch http://10.109.30.11/user/myrepository.git  master:root 

创建本地的root分支

同步一个远程的master分支到本地的root分支

 6、git branch

git branch -a查看全部分支

git branch -r查看远程分支

git branch 查看本地分支

7、git checkout  分支名(切换分支)

8、git merge 分支名(把指定的分支的修改合并到当前的分支)

git实例:

  1、git fetch root controller:controller

  2、git merge controller

  3、git push origin master:controller

原文地址:https://www.cnblogs.com/erdanyang/p/10310955.html