# Git & Github

# Git CLI cheat sheet

Initialize local repository and connect it to github

git init
git remote add origin  <REMOTE_URL> 

Alternatively - Copy a repo to your local machine

git clone <url>

Find out the status of all your files

git status

Bring the code down from your repository

git pull <remote> <branch>

git pull origin master

Add all of your changes to be committed

git add .

Commit your changes to the version history

git commit -m "My cool new version"

Push your changes up to the remote

git push <remote> <branch>

git push origin master

Create new local branch and checkout into newly created branch

git brach <branch-name>

get checkout <branch-name>

Push changes to remote repository

git push origin <branch-name>

Merge changes from master branch into the

git push origin <branch-name>

Check local branches

git branch -l

Check remote branches

git remote show origin