# ignore files whose suffix is .o or .a
*.[oa]
# you can negate a pattern by starting it with an exclation point(!)
!hello.o
# ignore files whose names end with a tilde, which is used by many text editors to mark temporary files
*~
# you can start patterns with a forward slash (/) to avoid recursivity
# follow line means just ignore .log in current directory
/.log
# you can end patterns with a forward slash (/) to specify a directory
# ignore entire models directory
models/
# ignore all .pdf files in the doc/ directory and any of its subdirectories
doc/**/*.pdf
Standard glob patterns work in gitignore, glob is very simple:
*
: matches zero or more characters[abc]
: matches any character insidethe brackets?
: matches a single character[0-5]
: matches 0,1,2,3,4a/**/z
: matches a/z, a/b/z, a/b/c/z and so on
.gitignore example for dozens of projects and languages at https://github.com/github/gitignore
Tools such as vimdiff and opendiff is not so accurate when search for modified codes as Beyond Compare.
- Install Beyond Compare
- Open Beyond Compare, click "Beyond Compare -> Install Command Line Tools..." item in its menu
- When you want to check the difference, just run
git difftool --tool=bc
, and you can also code in it - You can also run it with shell command
bcomp file1 file2
git commit --amend
: it will store staged file to repository and modify last commit message