1. 程式人生 > >git推送衝突

git推送衝突

當本地修改了A檔案,且add暫存commit成功。當向遠端庫推送時,發現遠端庫A檔案已經被更新過。此時推送會報衝突。

此時先執行  git rebase --abort 命令將當前的commit會回到rebase操作之前的狀態 。

然後再 git reset HEAD^ 撤回所提交的東西,自己修改的檔案退回工作區副本。

然後先貯藏本地修改,先拉取遠端檔案,再還原貯藏,修改衝突。然後add  、commit 、pull

參考部落格http://www.mamicode.com/info-detail-1812492.html

[email protected]
MINGW64 /f/project/FrontProject/map-manage-front-dev (develop|REBASE 1/1) $ git rebase --abort [email protected] MINGW64 /f/project/FrontProject/map-manage-front-dev (develop) $ git reset HEAD^ Unstaged changes after reset: M src/pages/App/AppClassify/components/Table/Table.vue M src/pages/orgMgt/DepAppMgt/components/OrganizerManagement/organizerManagement.vue M src/pages/virtualOrg/AppAuth/components/EimLeftRightList/leftRightList.vue
[email protected]
MINGW64 /f/project/FrontProject/map-manage-front-dev (develop) $ git pull --rebase First, rewinding head to replay your work on top of it... Fast-forwarded develop to ded8d0282cfe9d1cd02e4e2b69f272a4a92c21e5. [email protected] MINGW64 /f/project/FrontProject/map-manage-front-dev (develop) $