Skip to content

Instantly share code, notes, and snippets.

@libbyschuknight
Last active December 21, 2015 19:20
Show Gist options
  • Save libbyschuknight/993155b4e17937391680 to your computer and use it in GitHub Desktop.
Save libbyschuknight/993155b4e17937391680 to your computer and use it in GitHub Desktop.
Git stuff
git clone
git fetch origin branch - to get branch other than master
git checkout branch
IF HAVE PUSHED TO MASTER AND DIDN'T MEAN TO
git checkout -b libby
git stash save "Working on DOM"
git stash list
git checkout master
git log
git reset --hard 514bbe49c58d68070c3991585ec4da235d74a0e7 - get from log
git log
git push --force origin master
git checkout libby
git stash pop
# RENAMING A BRANCH LOCALLY
# If you want to rename a branch while pointed to any branch, simply do :
git branch -m <oldname> <newname>
# If you want to rename the current branch, you can simply do:
git branch -m <newname>
# A way to remember this, is -m is for "move" (or mv), which is how you rename files.
# will get rid of all changes that have been tracked
git checkout .
# git rid of changes that have not been tracked
git clean -f
# my git aliasis
alias zshconfig="atom ~/.zshrc"
alias ohmyzsh="atom ~/.oh-my-zsh"
alias loadzsh="source ~/.zshrc"
alias be="bundle exec"
alias ber="bundle exec rspec"
alias berf="bundle exec rspec --format documentation"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment