Last active
December 25, 2015 15:48
-
-
Save joelgriffith/7000453 to your computer and use it in GitHub Desktop.
Helpful git commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add a remote repository at URL named NAME | |
git remote add NAME URL | |
# Show me my local branches | |
git branch -a | |
# Show me my remote repositories | |
git remote -v | |
# Create a new local branch with NAME and switch to it | |
git checkout -b NAME | |
# Fetch all the data associated with this REMOTE repository | |
git fetch REMOTE | |
# Rebase the branch that I'm currently in (should be master!) with the data from REMOTE/master | |
# Note that it's important to fetch the data prior | |
git rebase REMOTE/master | |
# I'm done trying to rebase | |
git rebase --abort | |
# Merge the changes from BRANCH into the branch I'm currently in (usually for merging rebased changes in master to your feature branch) | |
git merge BRANCH | |
# WTF is git doing right meow | |
git status | |
# Fetch the updates from the upstream remote and rebase the branch I'm in with the changes from upstream/master | |
git fetch upstream && git rebase upstream/master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment