今天想把最近的一些代碼push到碼云上
先后運行:
git add .
git commit -m '一小段代碼'
git remote add origin git@github.com:*****.git
在這一步git status
發(fā)現(xiàn)一些順利吼驶,于是繼續(xù)執(zhí)行:
git pull origin master
git push -u origin master
發(fā)現(xiàn)報錯:
To https://gitee.com/WgLiux/Vuelearn.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://gitee.com/WgLiux/Vuelearn.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
搗鼓半天又是撤銷又是返回依然不行,明明pull過了,還提示git pull票摇,想著是不是pull寫錯了,查資料后改成:
git pull --rebase origin master
然后再執(zhí)行推送:
git push -u origin master
成功宾符!
如果依然不行匠抗,可嘗試git push -u origin master -f
強制push