9
我將一個git倉庫分隔爲3.我已經使用Detach (move) subdirectory into separate Git repository來分離文件夾,並將它們成功推送到新的git倉庫。在現有的回購,我已經使用以下命令清除移動的目錄。git push git過濾分支被拒絕
git filter-branch -f --index-filter "git rm -q -r -f --cached --ignore-unmatch lib/xxx/$REPO" --prune-empty HEAD
現在,當我在原來的回購做git st
,我得到:
# On branch 1.5.0
nothing to commit (working directory clean)
當我嘗試git push
,我得到:
! [rejected] 1.5.0 -> 1.5.0 (non-fast-forward)
error: failed to push some refs to '[email protected]:/xxx/.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
我的猜測是使用-f :git push -f origin <branch>
但我想確認,因爲這將修改我現有的回購。