<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://charlesreid1.com/w/index.php?action=history&amp;feed=atom&amp;title=Git%2FResolving_Push_Conflicts</id>
	<title>Git/Resolving Push Conflicts - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://charlesreid1.com/w/index.php?action=history&amp;feed=atom&amp;title=Git%2FResolving_Push_Conflicts"/>
	<link rel="alternate" type="text/html" href="https://charlesreid1.com/w/index.php?title=Git/Resolving_Push_Conflicts&amp;action=history"/>
	<updated>2026-06-19T21:36:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.12</generator>
	<entry>
		<id>https://charlesreid1.com/w/index.php?title=Git/Resolving_Push_Conflicts&amp;diff=22253&amp;oldid=prev</id>
		<title>Admin: Created page with &quot; Sometimes, when you try and push your commits with &lt;code&gt;git push&lt;/code&gt;, you&#039;ll see a message like this:  &lt;pre&gt; $ git push To https://github.com/siluria/transport.git Merge...&quot;</title>
		<link rel="alternate" type="text/html" href="https://charlesreid1.com/w/index.php?title=Git/Resolving_Push_Conflicts&amp;diff=22253&amp;oldid=prev"/>
		<updated>2017-11-17T23:52:17Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; Sometimes, when you try and push your commits with &amp;lt;code&amp;gt;git push&amp;lt;/code&amp;gt;, you&amp;#039;ll see a message like this:  &amp;lt;pre&amp;gt; $ git push To https://github.com/siluria/transport.git Merge...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
Sometimes, when you try and push your commits with &amp;lt;code&amp;gt;git push&amp;lt;/code&amp;gt;, you&amp;#039;ll see a message like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git push&lt;br /&gt;
To https://github.com/siluria/transport.git&lt;br /&gt;
Merge branch &amp;#039;master&amp;#039; of https://github.com/siluria/transport&lt;br /&gt;
 ! [rejected]        master -&amp;gt; master (fetch first)&lt;br /&gt;
error: failed to push some refs to &amp;#039;https://github.com/siluria/transport.git&amp;#039;&lt;br /&gt;
hint: Updates were rejected because the remote contains work that you do&lt;br /&gt;
hint: not have locally. This is usually caused by another repository pushing&lt;br /&gt;
hint: to the same ref. You may want to first merge the remote changes (e.g.,&lt;br /&gt;
hint: &amp;#039;git pull&amp;#039;) before pushing again.&lt;br /&gt;
hint: See the &amp;#039;Note about fast-forwards&amp;#039; in &amp;#039;git push --help&amp;#039; for details.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, if you try and pull the latest changes with &amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt;, you might see a message like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git pull&lt;br /&gt;
remote: Counting objects: 8, done.&lt;br /&gt;
remote: Compressing objects: 100% (8/8), done.&lt;br /&gt;
remote: Total 8 (delta 0), reused 2 (delta 0)&lt;br /&gt;
Unpacking objects: 100% (8/8), done.&lt;br /&gt;
From https://github.com/siluria/transport&lt;br /&gt;
   153782f..10e0b68  master     -&amp;gt; origin/master&lt;br /&gt;
Auto-merging twodomain/SubdomainCatalyst.py&lt;br /&gt;
Auto-merging twodomain/Interface.py&lt;br /&gt;
Auto-merging twodomain/Driver.py&lt;br /&gt;
CONFLICT (content): Merge conflict in twodomain/Driver.py&lt;br /&gt;
Automatic merge failed; fix conflicts and then commit the result.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, you can edit the file with the conflict, in this case, &amp;lt;code&amp;gt;Driver.py&amp;lt;/code&amp;gt;. You&amp;#039;ll see some lines like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD&lt;br /&gt;
old code&lt;br /&gt;
=======&lt;br /&gt;
new code&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; iss53&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit this file to merge the code however you decide. Once you do that, you&amp;#039;ll run &amp;lt;code&amp;gt;git add&amp;lt;/code&amp;gt; on the code with the file, which tells git you have resolved the conflict.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git add Driver.py&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then - this is key - you run &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt; with NO OTHER ARGUMENTS.&lt;br /&gt;
&lt;br /&gt;
If you try and add arguments, i.e., specifying which file to commit, or adding a commit message, you&amp;#039;ll see an error like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git commit Driver.py -m &amp;#039;resolving conflict.&amp;#039;&lt;br /&gt;
fatal: cannot do a partial commit during a merge.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Just run &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt; with no arguments:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git commit&lt;br /&gt;
[master d1d98ed] Merge branch &amp;#039;master&amp;#039; of https://github.com/siluria/transport&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you should be able to run &amp;lt;code&amp;gt;git push&amp;lt;/code&amp;gt; with no problems:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git push&lt;br /&gt;
Counting objects: 23, done.&lt;br /&gt;
Delta compression using up to 8 threads.&lt;br /&gt;
Compressing objects: 100% (12/12), done.&lt;br /&gt;
Writing objects: 100% (12/12), 1.48 KiB | 0 bytes/s, done.&lt;br /&gt;
Total 12 (delta 10), reused 0 (delta 0)&lt;br /&gt;
To https://github.com/siluria/transport.git&lt;br /&gt;
   10e0b68..d1d98ed  master -&amp;gt; master&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Git]]&lt;br /&gt;
[[Category:Github]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>