Skip to content

Instantly share code, notes, and snippets.

@chulini
Last active April 14, 2020 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chulini/bd2757ce7c2e4c1aeefec2c4a64138c4 to your computer and use it in GitHub Desktop.
Save chulini/bd2757ce7c2e4c1aeefec2c4a64138c4 to your computer and use it in GitHub Desktop.
# 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