想知道爲什麼我不能推動起源。這裏是一步一步的...git mv然後推問
git clone [email protected]:globegit/aRepository.git
cd aRepository
git branch --track mymaster master
git checkout master
git mv oldfile newfile
git status
- On branch mymaster
- Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
-
- renamed: oldfile -> newfile
-
git commit -m 'renamed a file'
git status
- On branch mymaster
- Your branch is ahead of 'master' by 1 commit.
-
nothing to commit (working directory clean)
罰款和花花公子,但爲什麼我不能推出這種改變到遠程?
是不是一個git-mv被認爲是一個改變,所以它數字我即時
與一個新的提交對象?
git push
Everything up-to-date
git push origin master
Everything up-to-date
感謝您的任何解釋!
我想我的困惑是部分與被用克隆創建的「master」分支是做什麼的對於。我認爲它是原產地/主人的別名,或者如果不是別名,則是原產地/主產地的追蹤分支,所以我的追蹤分店跟蹤主人並追蹤主人/原產地......所以一切都應該通過。可能不會。所以,真正的主分支是一個默認的禮物,並設置爲原產地/主人的追蹤者,我認爲。謝謝你的回答! –
當你創建一個新的分支時,它不會默認跟蹤任何東西。 「推送」的概念並不是將來自一個本地分支的更改合併到另一個本地分支,這就是'git-merge'的用途。 – meagar