Skip to content

Instantly share code, notes, and snippets.

@piyushdubey
Created February 12, 2013 05:39
Show Gist options
  • Save piyushdubey/4760497 to your computer and use it in GitHub Desktop.
Save piyushdubey/4760497 to your computer and use it in GitHub Desktop.
A very simplified Git Workflow that's easy to follow.. using git from command line is a lot of fun and seeing the code getting merged and branched using tools like GitX for mac, GitG for Gnome linux based systems and tortoiseGit for windows is a great way to learn git fundamentals and understand the workflow.
When you start working on a new feature, you must create a new local branch on your machine
$git branch <feature-name>
$git checkout <feature-name>
Then you work on it, commit as often as possible
Hack...
git commit -a -m "xxx "
Hack ...
git commit -a -m "xxxx "
Finally, when you are done, make sure that you commit the last changes.
$git commit -a -m "Finished feature X"
Now ready to merge back to master branch
$git checkout master
$git merge <feature-name>
And push to the central server, push your new branch first, then push the master branch.
$git push origin <feature-name>
$git push
That's it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment