Skip to content

Latest commit

 

History

History
45 lines (30 loc) · 680 Bytes

git.md

File metadata and controls

45 lines (30 loc) · 680 Bytes

Git

Edit commits

Edit last commit (without and with editing author):

git commit --amend
git commit --amend --author="Jakov Sosic <[email protected]>"

Export and import patches

Export:

git format-patch -<n> <SHA1> --stdout > /tmp/example.patch

Import:

git am /tmp/example.patch

Example (export last 10 commits):

git format-patch -10 HEAD --stdout > /tmp/0001-last-10-commits.patch
git am /tmp/0001-Commit-Message-of-the-Commit.patch

Ignore files without gitignore

To ignore a file localy, run:

git update-index --skip-worktree path/to/file

For unignore, run:

git update-index --no-skip-worktree path/to/file