$ git pull時遇到如下提示
$ git pull warning: no common commits remote: Counting objects: 5, done. remote: Compressing objects: 100% (4/4), done. remote: Total 5 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (5/5), done. From github.com:nonfuxinyang/android-study * [new branch] master -> origin/master There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull <remote> <branch> If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/<branch> master
看到第二個提示,我們現在知道了一種解決方案。也就是指定當前工作目錄工作分支,跟遠程的倉庫,分支之間的鏈接關系。<br>
比如我們設置master對應遠程倉庫的master分支
git branch --set-upstream master origin/master
這樣在我們每次想push或者pull的時候,只需要 輸入git push 或者git pull即可。
在此之前,我們必須要指定想要push或者pull的遠程分支。
git push origin master
git pull origin master.