[英]Can I sync a repo I've forked on GitHub without creating a commit in the parent?
[英]How to sync forked repository without creating a new commit
問題在於更新的提交,它們被粘合到一個提交中,它在fork日志中顯示為單個提交(10個或更多提交的組合)
這是預期的,因為你已經拉(獲取+ 合並 )
我建議你在本地刪除以刪除合並提交,並在upstream/master
上重新設置(即重放你的提交)( upstream
是原始倉庫的遠程名稱)
另外,我會在專門的分支中隔離這些變化,但是既然你已經從master
那里開始了PR,那就讓我們繼續master
。
確保您沒有任何正在進行的本地工作。
cd /path/to/local/repo
git remote add upstream <Repository URL>
檢查git remote -v
的輸出:你應該看到upstream
和origin
,原點引用你的fork。
git log # make sure master HEAD is at the right commit
git fetch upstream
git rebase upstream/master
# test if everything is still working
git push --force
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.