GIT ---- GIT 同步远程库操作

1. 查看分支

1.1 git branch

查看本地分支!

1.2 git branch -a

查看本地和远程所有分支!

1.3 git branch -r

查看远程库分支!

2.同步远程分支

2.1 git fetch

将本地分支与远程保持同步

2.2 git checkout -b 本地分支名 origin/远程分支名

拉取远程分支并同时创建对应的本地分支

2.3 git fetch --all

将本地所有分支与远程保持同步

2.4 git pull --all

拉取所有分支代码

3. 远程仓库地址操作

3.1 git remote -v

查看远程仓库地址!

3.2 git remote set-url origin url

直接修改远程仓库地址

3.3 git remote rm origin

删除本地远程仓库地址

3.4 git remote add origin url

添加新的仓库地址

猜你喜欢

转载自blog.csdn.net/m0_38082783/article/details/113557928