Linux Git推拉不起作用,编辑的代码不';t与现有回购协议合并
我正在尝试将一些更改推送到现有的github回购协议。我将repo克隆到我的计算机上,在其中的一些文件中更改了几行,然后尝试git push origin master。它返回以下内容:Linux Git推拉不起作用,编辑的代码不';t与现有回购协议合并,linux,github,linux-mint,Linux,Github,Linux Mint,我正在尝试将一些更改推送到现有的github回购协议。我将repo克隆到我的计算机上,在其中的一些文件中更改了几行,然后尝试git push origin master。它返回以下内容: To https://github.com/judah-tw/myrepo.git ! [rejected] master -> master (fetch first) error: failed to push some refs to 'https://github.com/juda
To https://github.com/judah-tw/myrepo.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/judah-tw/myrepo.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
error: merge is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
我尝试git pull origin master,结果显示:
warning: no common commits
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (23/23), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 85 (delta 19), reused 13 (delta 13), pack-reused 62
Unpacking objects: 100% (85/85), done.
From https://github.com/judah-tw/myrepo.git
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master
Auto-merging readme.txt
CONFLICT (add/add): Merge conflict in readme.txt
Auto-merging main.c
CONFLICT (add/add): Merge conflict in main.c
Automatic merge failed; fix conflicts and then commit the result.
git merge返回以下结果:
To https://github.com/judah-tw/myrepo.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/judah-tw/myrepo.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
error: merge is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
错误:无法合并,因为您有未合并的文件。
提示:在工作树中修复它们,然后使用“git add/rm”
提示:根据需要标记解析并进行提交。
致命:由于未解决的冲突而退出。
在工作树中修复它们意味着什么?我按照上的说明操作,但它们对我无效。您有冲突。您需要通过编辑
readme.txt
和main.c
文件来解决冲突。然后执行git add readme.txt main.c
然后执行git commit
@RedCricket冲突是什么意思?这些文件与repo上的文件不同是的,这就是要推送更改的文件并更新repo上的旧文件。如果存在冲突,推送相同的文件根本不会改变回购协议。您需要通过编辑readme.txt
和main.c
文件来解决冲突。然后执行git add readme.txt main.c
然后执行git commit
@RedCricket冲突是什么意思?这些文件与repo上的文件不同是的,这就是要推送更改的文件并更新repo上的旧文件。推送相同的文件根本不会改变回购协议