scott.mebberson.codes

Git

Git

$ git diff > changes.patch

Create a patch file.

$ git diff {commit-hash} > changes.patch

Create a patch file containing multiple commits. The patch will contain changes from all commits after {commit-hash} but not including.

$ git apply changes.patch

Apply a patch file.

$ git push --delete origin <tag>

Delete a git tag on a remote server.

$ git worktree add ../new-location branch-name

Create another version of the repository in another location.

$ git worktree remove -f ../new-location

Remove a worktree.