Skip to content

Latest commit

 

History

History
73 lines (40 loc) · 1.87 KB

Notes.md

File metadata and controls

73 lines (40 loc) · 1.87 KB

Difference between git reset --hard and git revert <shaHere>

tl;dr: ,There is a very great significance of using revert instead of git reset coz it preserver all history and its important if you pushed earlier commmit to public and want it to be undone(remove) and still don't want to force push then git revert rocks coz it does exactly that! Read below like for more insights!.

- Do u know that if your repo does not accepting changes updates via git pull, you can use git pull -f and it'll forcefully update your current repo with github database of your repo

Git push -f will forcely push your repo to Github , but only use this when your git refuse to push it into your repo

Made a gacp function in bash alias, Windows

  • gac (){

    echo + git add .

    git add .

    echo + git commit -m \'$@\'

    git commit -m "$*" # gac life is amazing adders

}

Usage: gacp life is super amazing.

  • gacps shortcuts life to project pushing quicker.

gacp (){

echo + git add .

git add .

echo + git commit -m \'$@\'

git commit -m "$*"

echo + git push -f

git push -f

}

Do you know that you can manage two githubs at same computer using this technique

User1 github handler

Host User1 github.com

HostName github.com

User git

IdentityFile ~/.ssh/id_rsa_User1 

User2 github handler

Host User2 github.com

HostName github.com

User git

IdentityFile ~/.ssh/id_rsa_User2