Some Git commands I have come to use

Create remote tag

Syntax: git tag -a [name] -m '[comment]'
E.g:	git tag -a v0.7.1 -m 'v0.7.1'

Delete local tag

Syntax: git tag -d [tagname]
E.g:	git tag -d v0.7.1

Delete remote tag

Syntax: git push origin :refs/tags/[name]
E.g:	git push origin :refs/tags/v0.7.1

Force new tag

Syntax: git tag -f -a [existingname] -m '[comment]'
E.g:	git tag -f -a v0.7.1 -m 'v0.7.1'

Reset to a commit

git reset --hard a6b4c974

Existing repo

git clone
(No need to create directory)

Create remote branch

git checkout -b develop
git push -u origin develop

Delete remote branch

Syntax: git push origin :[remotename]
E.g:	git push origin :mybranch

Stash – save to not get changes in other branches

Syntax:	git stash save '[comment]'

Apply stash

Syntax:	git stash apply

Remove stash

Syntax:	git stash clear

Example when setting up new GitHub Repo

Global setup:
 Download and install Git
  git config --global user.name "Daniel Danielsson"
  git config --global user.email daniel@not-a-valid-domain.com
        
Next steps:
  mkdir PROJ
  cd PROJ
  git init
  touch README
  git add README
  git commit -m 'first commit'
  git remote add origin git@github.com:username/PROJ.git
  git push -u origin master
      
Existing Git Repo:
  cd existing_git_repo
  git remote add origin git@github.com:username/PROJ.git
  git push -u origin master