git code snippets

git code snippets

Dec 29, 2020 12:25 PM

Add all files

git add *

Commit files

git commit -m "here goes the message"

Push to source

git push

Clone a repo to a directory in local

git clone

Create new branch / Switch to a branch

git checkout -b new_branch
git checkout different_branch

Setup upstream branch and push to it

git push --set-upstream origin new_branch