git push了但是文件未更新
2024年1月29日大约 1 分钟约 306 字
方法一:
git push -u origin master方法二:
先改变remote
git remote set-url origin [URL]之后再git push origin master即可成功
出现错误:
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'xxxxxx/JIRA_data_analysis_tool'
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
CONFLICT (add/add): Merge conflict in server/static/index.html
Auto-merging server/static/index.html
Automatic merge failed; fix conflicts and then commit the result.问题:
origin的意思是什么?
可以使用git branch -r ,查看远程的分支名
git push origin master:refs/for/master ,即是将本地的master分支推送到远程主机origin上的对应master分支, origin 是远程主机名,
第一个master是本地分支名,第二个master是远程分支名。关于 refs/for
// refs/for 的意义在于我们提交代码到服务器之后是需要经过code review 之后才能进行merge的,而refs/heads 不需要