git

progit Git command

Git use SHA1 for checksum

SHA1: 160 bit 40 hex char

  • If you don’t want to type it every single time you push, you can set up a “credential cache”. The simplest is just to keep it in memory for a few minutes, which you can easily set up by running git config --global credential.helper cache.

Back up git branch

To back up a branch before taking any destructive action, like a rebase or force push:

  1. Open your feature branch in the terminal: git checkout my-feature
  2. Create a backup branch: git branch my-feature-backup Any changes added to my-feature after this point are lost if you restore from the backup branch.

Your branch is backed up, and you can try a rebase or a force push. If anything goes wrong, restore your branch from its backup:

  1. Make sure you’re in the correct branch (my-feature): git checkout my-feature
  2. Reset it against my-feature-backupgit reset --hard my-feature-backup

Automatically Update the Local Branch with the Remote Version When Switching Branches in Git - DEV Community