RSS Amplifier

Robin Wils's website · Oct 22, 2022

Git

0
Sign in to vote or save

robinwils.com

NOTES1

← Notes

Last modified:

Basics

Add

# Add specific file
git add ' / '  

# Add all not hidden files
git add *

# Add all hidden files
git add .*

Status

git status

Remove 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 --force

Push changes

git push

Branches

Rebase

git checkout some-feature
git rebase master

Show branches

git branch -a

NOTES3

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 push

Remote add

git remote add origin https://github.com/user/repo.git

Remote delete

git remote rm origin

Read the original on robinwils.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.

    Reading · Robin Wils's website · RSS Amplifier