Skip to content

Instantly share code, notes, and snippets.

@ishannla
Created December 27, 2017 00:46
Show Gist options
  • Save ishannla/abcc38810bc6ecd0a00ee4646f7d961c to your computer and use it in GitHub Desktop.
Save ishannla/abcc38810bc6ecd0a00ee4646f7d961c to your computer and use it in GitHub Desktop.
Git
git add FILE_1 FILE_2
git commit
//need to manually add each new file
git add -A
git commit -a
git commit -m "commit message"
git commit -m "Close #2"
git push origin master
git init
git add .
git commit -m "First commit"
git remote add origin REPO_URL
git push -u origin master
list changed files = "git status"
list branches = "git branch"
pull from master = "git pull"
//enter this command once for each commit you want to revert
git reset --hard HEAD^
git push origin +master --force
GITHUB - cd to project location before running git commands
git config core.filemode false
git pull --rebase origin master // WILL GIVE ERROR
RESOLVE CONFLICTS
git add .
git rebase --continue
git push origin master
git add .
git commit -m "Test"
git push origin master
DON'T HAVE CURRENT WORK
git pull --rebase origin master
UNSTAGED CHANGES ERROR
git stash
git pull --rebase origin master
git add .
git push origin master
git checkout -b gh-pages
git merge master (master -> gh-pages)
git push origin gh-pages
git remote -v
MAKE SURE TO BE IN THE FOLDER
git remote add upstream https://github.com/INFO-201/m10-apis.git
git pull upstream master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment