GitHub Cheat-sheet

While moving my code to GitHub I’ve made short list of commands one needs know to get going with git and GitHub. To get started, I’ve found this short tutorial useful.

To add an existing file to version control.


git add "filename"

To commit a change with message “message”


git commit -m "message"

To create a branch


git checkout  -b "branch-name"

To switch between branches


git checkout "branch name"

To see current active branch and list of existing branches


git branch

To push changes back to the server


git push origin "branchname"

To update a branch


git pull origin "branchname"

.

That’s it for now. It is enough to begin to work with GitHub. The list of commands will grow with my experience.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s