Skip to content

Instantly share code, notes, and snippets.

@barlas
Last active September 1, 2016 13:45
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 barlas/a4cfec32c91111c79cb4 to your computer and use it in GitHub Desktop.
Save barlas/a4cfec32c91111c79cb4 to your computer and use it in GitHub Desktop.
git reset --hard
branches:
git branch
git checkout -b [branch-name]
git checkout [branch-name]
git branch -D [branch-name]
// setup
- fork repo
git clone (ssh url)
// check all remotes (upstream)
git remote -v
git remote add upstream (master branch's ssh url)
// unstage
git add -u
git reset -- main/dontcheckmein.txt
git checkout src/stylus/shared/_borders.styl
git commit -m "Msg."
git push origin master
git status
// commit
git add .
git commit -m "Msg."
git push origin master
- merge from github
// update
git pull origin master
// update from master to forked repo
git fetch upstream
git merge upstream/master
git commit -a -m "Msg."
git push origin master
// creating global .gitignore file for my computer
git config --global core.excludesfile ~/.gitignore_global
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment