915
edits
Changes
wori
[[Category: Coding]]
[[Category: Bioinformatics]]
[[Category: Github]]
==Useful References==
Github cheatsheet - http://help.github.com/git-cheat-sheets/
Git manual - http://schacon.github.com/git/user-manual.html
Git installation - http://help.github.com/linux-set-up-git/
Forking an existing repository - http://help.github.com/fork-a-repo/
==Making Changes to Code==
* It is generally best practice to work on a branch for each improvement, then merge that back into a working master branch once you are finished.
* Create a branch. Each branch is a complete clean version of the code, and will not affect other branches.
<pre>git branch [name of your new branch]</pre>
* Switch to that branch
<pre>git checkout [name of the branch you want to switch to]</pre>
* Make some changes to a file and save it (i use Notepad++ in windows and Gedit in linux)
* Commit the changes. This saves those changes to your revision history. This is useful to find out when changes happened and to go back to when things were working. You want to commit often! Try to make the message useful, as in I did X to Y. Try not to do "changed stuff" or "fixed some mistakes"
<pre>git commit -m "This is the message describing the commit"</pre>
* Intermittently push those changes back to Github (especially if you are working on a couple of computers)
<pre>git push origin [name of your new branch]</pre>
* Once you are done working on a branch go back to your original branch (normally master) and pull in changes from your modified branch. Once its working, you can optionally delete the branch if you dont think you are going to need it in the future.
<pre>
git checkout master
git merge [name of your new branch]
git branch -d [name of branch you want to delete]
</pre>
==Merging Changes Made in Other Branches==
[[Category: Bioinformatics]]
[[Category: Github]]
==Useful References==
Github cheatsheet - http://help.github.com/git-cheat-sheets/
Git manual - http://schacon.github.com/git/user-manual.html
Git installation - http://help.github.com/linux-set-up-git/
Forking an existing repository - http://help.github.com/fork-a-repo/
==Making Changes to Code==
* It is generally best practice to work on a branch for each improvement, then merge that back into a working master branch once you are finished.
* Create a branch. Each branch is a complete clean version of the code, and will not affect other branches.
<pre>git branch [name of your new branch]</pre>
* Switch to that branch
<pre>git checkout [name of the branch you want to switch to]</pre>
* Make some changes to a file and save it (i use Notepad++ in windows and Gedit in linux)
* Commit the changes. This saves those changes to your revision history. This is useful to find out when changes happened and to go back to when things were working. You want to commit often! Try to make the message useful, as in I did X to Y. Try not to do "changed stuff" or "fixed some mistakes"
<pre>git commit -m "This is the message describing the commit"</pre>
* Intermittently push those changes back to Github (especially if you are working on a couple of computers)
<pre>git push origin [name of your new branch]</pre>
* Once you are done working on a branch go back to your original branch (normally master) and pull in changes from your modified branch. Once its working, you can optionally delete the branch if you dont think you are going to need it in the future.
<pre>
git checkout master
git merge [name of your new branch]
git branch -d [name of branch you want to delete]
</pre>
==Merging Changes Made in Other Branches==