Last active
June 16, 2022 05:26
-
-
Save rurumimic/51dd9e1087faac553987e14c2910b7df 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
# github cli | |
brew install gh | |
gh auth login | |
# fork | |
gh repo fork <user>/<repo> | |
# remote | |
cd <repo> | |
git remote -v | |
# origin git@github.com:rurumimic/<repo>.git (fetch) | |
# origin git@github.com:rurumimic/<repo>.git (push) | |
# upstream git@github.com:<user>/<repo>.git (fetch) | |
# upstream git@github.com:<user>/<repo>.git (push) | |
# clone | |
## gh repo clone <my>/<repo>.git | |
# add upstream | |
## git remote add upstream https://github.com/<user>/<repo>.git | |
# new branch and checkout | |
# git branch -a | |
git checkout -b <branch> | |
## git branch <branch> | |
## git checkout <branch> | |
# commit | |
git commit -a -m 'made other changes' | |
## git add . | |
## git commit -m 'message' | |
# log | |
git log --oneline --decorate --graph --all | |
# push | |
# git push <remote> <branch> | |
git push origin <branch> | |
# push request | |
gh pr status | |
gh pr checkout <number> | |
gh pr create | |
# fetch upstream | |
git fetch upstream master | |
# pull upstream | |
git pull upstream <branch> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment