Git Cheatsheet Part 3: Remote Repository
Table of Contents
远程仓库
添加远程仓库 查看远程仓库 1
git remote add <remote-name> <remote-url>
删除远程仓库
1
git remote -v
重命名远程仓库 1
git remote rm <remote-name>
从远程仓库拉取代码
1
git remote rename <old-name> <new-name>
fetch默认远程仓库(origin)当前分支的代码,然后合并到本地分支
1
git pull <remote-name> <branch-name>
将本地改动的代码rebase到远程代码最新的代码上(为了有一个干净的线性的提交历史)
1
git pull
推送代码到远程仓库(然后再发起pull request) 1
git pull --rebase
获取所有远程分支 1
git push <remote-name> <branch-name>
查看远程分支 1
git fetch <remote-name>
fetch某一个特定的远程分支 1
git branch -r
1
git fetch <remote-name> <branch-name>
Git Cheatsheet Part 3: Remote Repository