Last active
April 14, 2020 06:42
-
-
Save chulini/bd2757ce7c2e4c1aeefec2c4a64138c4 to your computer and use it in GitHub Desktop.
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
# Setup | |
## Put you local changes to a new repo | |
```git init | |
git add -A . | |
git commit -m "first commit" | |
git remote add origin https://github.com/chulini/test.git | |
git push -u origin master``` | |
# Push/Pull | |
## Add local changes, commit and push | |
```git add -A . | |
git commit -m "your description" | |
git push``` | |
## Pull request | |
```git request-pull master ./``` | |
## Reset to the last commit on master (or other) branch | |
```git fetch origin | |
git reset --hard origin/master``` | |
# Branches | |
## See all branches | |
```git branch``` | |
## Create and switch to a NEW branch | |
```git checkout -b <branch>``` | |
## Switch to an exising branch | |
```git checkout master``` | |
## Delete a branch | |
```git branch -d <branch>``` | |
## Push to a branch | |
```git push origin <branch>``` | |
## See changes between branches | |
git diff <source_branch> <target_branch> | |
## Merge to master | |
After you have your branch ready | |
```git checkout master``` | |
```git merge <branch>``` | |
## Pull request to master | |
```git request-pull master ./``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment