Typical Git workflow: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 90: Line 90:


To merge another branch into your active branch (e.g. master), use  
To merge another branch into your active branch (e.g. master), use  
<pre>git merge &lt;branch&gt; </pre>  
<pre>git merge $BRANCH</pre>  
in both cases git tries to auto-merge changes. Unfortunately, this is not always possible and results in conflicts. You are responsible to merge those conflicts manually by editing the files shown by git. After changing, you need to mark them as merged with<br>
in both cases git tries to auto-merge changes. Unfortunately, this is not always possible and results in conflicts. You are responsible to merge those conflicts manually by editing the files shown by git. After changing, you need to mark them as merged with<br>  
<pre>git add &lt;filename&gt; </pre>
<pre>git add &lt;filename&gt; </pre>  
before merging changes, you can also preview them by using
before merging changes, you can also preview them by using  
<pre>git diff &lt;source_branch&gt; &lt;target_branch&gt;
<pre>git diff &lt;source_branch&gt; &lt;target_branch&gt;
</pre>
</pre>