command | effect |
---|---|
git restore –staged <filename> | remove last commit from staging |
git rebase -i $(git merge-base this-branch main) | rebase interactively all commits on this-branch |
git reset HEAD~2 | undo last two commits |
git restore filename<br>git checkout – filename | Undo all changes |
git blame -L 15,26<br>git log -L 15,26 file-path | limit commands to a range |
git log -S pattern | commits that changed specified pattern |
git clean -dfX | remove untracked files and directories forcefully |
Gitlab
command | effect |
---|---|
git push -o ci.skip | push without triggering a pipeline run |
git push -o merge_request.create | create a merge request automatically |
git commit –allow empty -m ‘it works!’ | empty commit e. g. to trigger a build |