- user.email=aryans.vinay@gmail.com
- user.name=Vinay Aggarwal
- core.repositoryformatversion=0
- core.filemode=true
- core.bare=false
- core.logallrefupdates=true
- core.editor=subl
- color.diff=auto
- color.status=auto
- color.branch=auto
- color.interactive=auto
- color.diff=auto
$ git status -s
M README
MM Rakefile
A lib/git.rb
M lib/simplegit.rb
?? LICENSE.txt
- Blank lines or lines starting with # are ignored.
- Standard glob patterns work.
- You can end patterns with a forward slash (/) to specify a directory.
- You can negate a pattern by starting it with an exclamation point (!).
Glob patterns are like simplified regular expressions that shells use. An asterisk (*) matches zero or more characters; [abc] matches any character inside the brackets (in this case a, b, or c); a question mark (?) matches a single character; and brackets enclosing characters separated by a hyphen([0-9]) matches any character between them (in this case 0 through 9). You can also use two asterisks to match nested directories; a/**/z would match a/z, a/b/z, a/b/c/z, and so on.
*.a
!lib.a
/TODO
build/
doc/*.txt
doc/**/*.txt
git diff
# only unstagedgit diff --staged
# only stagedgit diff --cached
# synonym of --staged
git commit -m "commit message"
git commit -a -m "commit message"
# skip staging and add/commit everything tracked
git rm filename.md
git rm --cached filename.md
# remove from git but not from directorygit rm log/\*.log
# Pass patterns
Note the backslash ( \ ) in front of the *. This is necessary because Git does its own filename expansion in addition to your shell’s filename expansion. This command removes all files that have the .log extension in the log/ directory. Or, you can do something like this:
git mv
-
git log
-
git log -3
# limit 3 -
git log -p
# show diff as well -
git log --author vinay
-
`git log --stat # Show the stat (no of lines changed)
-
git log --pretty=format:"%h - %an, %ar : %s"
-
git log --since
$ git log -S "core.editor" commit 5ea9fa63d0d5522a0ffdfc08ee2a6fbf93e69c0e Author: Vinay Aggarwal aryans.vinay@gmail.com Date: Wed May 13 20:31:54 2015 +0530
Learning core.editor setting
Few Other switches are --since, --after, --until, --before, --author, --committer, --grep, -S
- Remove it from your staging area
- Remove / Undo anything un-committed