Wednesday, January 22, 2025

GIT useful

Common Git Commands:-


//screw all the local commits and set to the origin branch

How do I reset my local branch to be just like the branch on the remote repository?

git fetch origin
git reset --hard origin/master

https://stackoverflow.com/questions/1628088/reset-local-repository-branch-to-be-just-like-remote-repository-head

 

git branch -vv | sls "\[.*: gone\]" | % { git branch -D ($_.Line.Trim() -split '\s+')[0] } 

No comments:

Post a Comment