https://github.com/github/gitignore provides a whole bunch of sample ignore files.
For instance:
cd $HOME/workspace/
git clone https://github.com/github/gitignore.git
git config --global core.excludesfile $HOME/workspace/gitignore/Global/Eclipse.gitignore
That may be very occasionally useful but I cannot see any good reason to often have untracked files not excluded by .gitignore. As said above, developers already happen to forget files in their commits, such an option will get it worse.
As of Git 1.8.3 (May 24, 2013), you can now have (automatic) more comprehensive and useful colors on commits, branches and tags using %C(auto)
:
git log --graph --pretty=format:'%C(auto)%h -%d %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
As of git 1.8.3 (May 24, 2013), add %C(auto)
to colorize the output:
$ git config --global alias.id "show -s --pretty=format:'%C(auto)%h%d'"
Nice. Here's a slightly changed @jacaetevha version with colors, recursion and author output option removed:
https://gist.github.com/jcarsique/5958214
Great use of --fixup
and --autosquash
options!
However, it will fail on Shells which don't have the <<<
redirection operator (such as dash).
It is possible to detect if stash is required using diff-index instead of grep:
fix = "!_() { c=$(git rev-parse $1) && git commit --fixup $c && git diff-index --quiet HEAD; s=$?; [ $s != 0 ] && git stash; git -c core.editor=cat rebase -i --autosquash $c~; [ $s != 0 ] && git stash pop; }; _"
Thanks, your alias is really useful.
Also, for Firefox 17+, open about:config and set:
general.autoScroll = true
mousewheel.with_shift.action = 1
- optionally configure the scroll speed with
mousewheel.with_shift.delta_multiplier_x = 300
Great. Here is as a Git alias:
authorship = "!git ls-files -z|xargs -0 -n1 -E'\n' -J {} git blame --date short -wCMcp '{}'| perl -pe 's/^.?\((.?) +\d{4}-\d{2}-\d{2} +\d+\).*/\1/'| sort | uniq -c | sort -rn"
I don't see the point of fixprev and sqprev since they are equivalent to
git commit --amend [--no-edit]
I wrote an alias leveraging those
--fixup
and--autosquash
options: https://gist.github.com/jcarsique/24f8dd46d176bb67253eI use it every day combined with
git add -p
to separate the fommatting and cleanup changes from the important code changes, or to distribute the changes on the relevant commits.Worth to mention that this command changes the Git history: to be used on a local or "feature" branch.
Simplified since Git 1.8.4 with
--autostash
:Usage:
git add ... # stage changes to fix up
git fix <rev>
That will temporarily stash the current changes if any and fixup the given revision with the staged changes.