Skip to main content

git

How do I undo 'git add' before commit?​

git reset <file>

How do I undo git add after commit ?​

  • Uncommit the most recent commit
git reset --soft HEAD~1
  • Now undo add with git reset <file>

Ref: https://stackoverflow.com/a/15321456/4814427

How to store secret or encrypt some file in git repository​

Ref: https://stackoverflow.com/questions/48330742/file-encryption-in-git-repository

How to delete a branch​

Remote: git push -d <remote_name> <branchname> Local: git branch -d <branchname>

Ref: https://stackoverflow.com/a/2003515

git re add deleted file​

git checkout HEAD src/path/file

Ref: https://stackoverflow.com/a/22976202/4814427

How revert to a previous commit in remote​

https://hackernoon.com/how-to-delete-commits-from-remote-in-git

git flow​

git rebase​

git encrypt​

  • git-encrypt
    • to encrypt some of credential files

Differene between​

git config pull.rebase false # merge git config pull.rebase true # rebase git config pull.ff only # fast-forward only

git proxy config​

git config --global http.proxy http://172.16.56.149:80