Skip to content

Instantly share code, notes, and snippets.

@claudiosanchez
Created December 17, 2015 21:47
Show Gist options
  • Save claudiosanchez/bfafd397f922dca2623b to your computer and use it in GitHub Desktop.
Save claudiosanchez/bfafd397f922dca2623b to your computer and use it in GitHub Desktop.
Uncle P's corner of git sweetness

Uncle P's corner of git sweetness

Git resources

Interactive guides

Top N git commands used in a Pull Request based Workflow

Initial commands (cloning, fetching, pulling banching, etc)

Cloning a remote repository

git clone [git repo url]

Listing local branches

git branch --list

Checking out a branch

git checkout -b [branchname]

Deleting a branch

git branch -d [branchname]

Discarding any non-commited changes in your current branch

git reset --hard

Pushing your changes (typically after a rebase) to the remote branch by force

git push origin [branch name] -f

Discarding any non-commited changes in your current branch

git rebase origin [branchname]

Making your local branch point to the current HEAD on the remote branch

git reset origin [branch name]

Checking out a new branch that exists in remote, but not locally.

This is extremely useful when starting new development on a branch created already on the remote repository. git checkout [branch name]

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