Deal with "Your local changes...would be overwritten

  git reset -- hard       # this kills all local changes, careful!
  git pull

Switch to (remote) branch

  $ git checkout -b <branch> --track <remote>/<branch>

Update submodule to latest

  cd submodule_name
  git checkout master && git pull
  cd ..
  git add submodule_name
  git commit -m "updating submodule to latest"

See what branch we are on

  $ git branch -a

View graph of branches

git log --graph --oneline --decorate
git log --graph --oneline --decorate --all

Undo changes to one file


  $ git checkout -- file

Avoiding to always type password

Normal editing

  $ git clone ssh://
  $ cd Proto0_Blade
  $ (edit files)
  $ git commit -a     # commit changes (not new files) to local
  $ git push --all    # push changes back to master on remote

To check out a specific revision, figure out the SHA1 code (long hex string), then:

  $ git fetch origin <SHA1>
  $ git reset --hard <SHA1>
Last modified 7 weeks ago Last modified on Oct 14, 2020, 12:27:06 PM