— Git Cheats

Go to your directory where you want to your own local repository
cd ~/
mkdir newreponame

Add “Read Me” file that describes your code
echo "# Learning Git" >> README.md

Intialize Git
git init

Add “Read Me” file
git add README.md

Mark all of your current files to be pushed to the Origin
git add *

Add your Commit message
git commit -m "my first commit"

Add the remote Origin repo
git remote add origin https://gitsomewhere/username/nameofrepo.git

Check remote origins that are configured
git remote -v

Delete origin if needed
git remove rm origin

Configure Global Variables
git config --global user.email "your.email@email.com"
git config --global user.name "git-repo username"

Pull files down to local repo for the latest
git pull

Push all local files
git push

Make some changes to your local files, commit and push again
git commit -a -m "updated README file"
git push

Rename Git branch
git branch -m old_name new_name
-or-
git push origin :old_name
git push --set-upstream origin new_name