我周圍搜索,發現沒有回答這個問題。我有一個在Heroku上運行的應用程序。 從我的本地機器我通常實現公正:Git - 比較本地和遠程而不先獲取?
git add .
git commit -m "whatever change, I know I can add and commit at the same time..."
git push <the-heroku-repo>
然後上升和Heroku的應用程序中的主分支被更新。到現在爲止還挺好。
現在。我想要另一臺機器,它會自動從Heroku倉庫中取出並更新它自己。
所以我這樣做有:
git clone <the-heroku-repo>
這讓我的應用程序,我可以看到與此混帳配置:
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
[email protected]:theapp.git
branch.master.remote=origin
branch.master.merge=refs/heads/master
要更新這個新的回購協議,我可以做只是一個拉:
git pull origin
或者,我可以取回併合並:
git fetch origin
git merge origin/master
我的問題
上述期間取回併合並這樣做,我可以檢查哪些變化:
git log -p master..origin/master
有沒有辦法找到當地主分支和最新之間的差異版本在遠程Heroku回購沒有提取之前?只需比較本地和遠程並查看更改。我無法找到正確的方法。
謝謝。
沒有提取,你不會知道什麼從遠程repo更新 –
我感興趣的問題是在'git log'前做'git fetch origin'? –
也許問題在於我,根據fetch命令的定義:「git fetch從遠程存儲庫下載新的分支和數據」。想象一下,根據比較的某些輸出,我會決定我不想獲取併合並這些更改。爲什麼我會使用帶寬並使用不需要的東西來監控存儲庫。再次,也許問題是我。只要可能,通過了解現有的變化,就試圖保存一個電話或資源。 – Pod