Typical Git workflow: Difference between revisions

m
no edit summary
mNo edit summary
Line 58: Line 58:
== 4) Add / Commit changes to a Local Machine  ==
== 4) Add / Commit changes to a Local Machine  ==


You can propose changes (add it to the Index) using <br>
You can propose changes (add it to the Index) using <br>  
<pre>git add &lt;filename&gt;  
<pre>git add &lt;filename&gt;  
</pre><pre>git add * </pre>
</pre><pre>git add * </pre>  
This is the first step in the basic git workflow. To actually commit these changes use:<br>
This is the first step in the basic git workflow. To actually commit these changes use:<br>  
<pre>git commit -m "Commit message"
<pre>git commit -m "Commit message"
</pre>
</pre>  
Now the file is committed to the HEAD, but not in your remote repository yet.<br>
Now the file is committed to the HEAD, but not in your remote repository yet.<br>  


'''Pushing Changes:'''<br>
'''Pushing Changes:'''<br>  


Your changes are now in the HEAD of your local working copy. To send those changes to your remote repository, execute
Your changes are now in the HEAD of your local working copy. To send those changes to your remote repository, execute  
<pre>git push origin master
<pre>git push origin master
</pre>
</pre>  
Change master to whatever branch you want to push your changes to.<br>
Change master to whatever branch you want to push your changes to.<br>  
 
== 5) Get back in sync with changes commited by others ==