Skip to content

Instantly share code, notes, and snippets.

@barlas barlas/git-fork-logic.txt
Last active Sep 1, 2016

What would you like to do?
git reset --hard
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
You can’t perform that action at this time.