Created
December 27, 2017 00:46
-
-
Save ishannla/abcc38810bc6ecd0a00ee4646f7d961c to your computer and use it in GitHub Desktop.
Git
This file contains 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
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 | |
This file contains 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
git init | |
git add . | |
git commit -m "First commit" | |
git remote add origin REPO_URL | |
git push -u origin master |
This file contains 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
list changed files = "git status" | |
list branches = "git branch" | |
pull from master = "git pull" |
This file contains 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
//enter this command once for each commit you want to revert | |
git reset --hard HEAD^ | |
git push origin +master --force |
This file contains 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
GITHUB - cd to project location before running git commands | |
git config core.filemode false |
This file contains 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
git pull --rebase origin master // WILL GIVE ERROR | |
RESOLVE CONFLICTS | |
git add . | |
git rebase --continue | |
git push origin master |
This file contains 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
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 |
This file contains 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
git checkout -b gh-pages | |
git merge master (master -> gh-pages) | |
git push origin gh-pages |
This file contains 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
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