Archive for the ‘git’ Category

git rename most recent commit

git commit –amend -m "an updated commit message"

git remove local stale branches which already deleted remotely

git reset single file

git reset — path/to/file git checkout — path/to/file

Git reset local master to match remote master

git reset –hard origin/master

Creating patch

git format-patch -1 SHA5

How-to check git history of single file

gitk /path/to/file

Git show remote url

git remote show origin git ls-remote –heads | grep 1234

Git rollback to particular commit

Use gitk to find out which commit you want to rollback and do the following: git reset –hard 53c309929253a2a

git new branch

git checkout -b new_branch_name

git remove remote branch

git push origin –delete feature/login git push origin :feature/login