當(dāng)提交代碼到遠(yuǎn)程時(shí),遇到?jīng)_突或者需要pull遠(yuǎn)程代碼情況,一般建議先暫存本地代碼鸭丛,更新代碼庫最新后再去提交后频;
先暫存本地修改的代碼梳庆,寫上日志后面找尋用到
git stash [日志]
更新遠(yuǎn)程代碼,最后使用--rebase模式
git pull --rebase
有沖突解決沖突卑惜,確認(rèn)本地代碼最新后
查看暫存列表
git stash list
復(fù)制index膏执,應(yīng)用剛剛暫存的代碼
gti stash apply @stash{index}
提交推送
git commit
git push