NOTES1
Last modified:
Basics
Add
# Add specific file
git add ' / '
# Add all not hidden files
git add *
# Add all hidden files
git add .*Status
git statusRemove file from staging area
git rm --cached ' ' NOTES2
Make commit
git commit -m "Your commit message"Remove commit on remote
git reset --hard HEAD~1
git push --forcePush changes
git pushBranches
Rebase
git checkout some-feature
git rebase masterShow branches
git branch -aNOTES3
Switch to existing branch
# Use tab completion, usually looks like origin/ .
git checkout -b ' ' Make new branch with code from master
git checkout -b ' '
git push origin ' ' Delete local branch
git branch -d ' ' Delete remote branch
git push --delete origin ' ' Rename branch
git branch -m ' ' ' '
git push --delete origin ' '
git branch --unset-upstream
git push --set-upstream origin ' ' NOTES4
Merge
# Switch to branch for example master
git checkout -b master
# Pull changes from branch with new changes
git pull origin ' '
# Push it, if merges do commit first
git pushRemote add
git remote add origin https://github.com/user/repo.gitRemote delete
git remote rm origin
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.