Skip to content

Instantly share code, notes, and snippets.

@pnavarrc
Last active October 6, 2015 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pnavarrc/0c6fc4b3cd2bbec0a8c4 to your computer and use it in GitHub Desktop.
Save pnavarrc/0c6fc4b3cd2bbec0a8c4 to your computer and use it in GitHub Desktop.
Git Essential Commands

Basic Git Commands

List Local Branches

git branch

Commit

git commit -am 'Commit comment'

Create a New Branch

# Go to the base branch first
git checkout -b new_branch_name

Switch to an Existing Branch

git checkout branch_name

Push a Local Branch to a Remote (GitHub)

git push -u origin branch_name

Pull Changes from a Remove (GitHub)

# Switch to a branch to merge the remote to the local
git pull

Merge

# Go to the target branch
git merge --no-ff current_branch target_branch
@pnavarrc
Copy link
Author

pnavarrc commented Oct 6, 2015

Some git commands @amyngai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment