Lists ONLY the files changed by the given HASH/HEAD/list of hashes, etc. The message, commit ID, author, etc. is not included
Display condensed log in a tree-like format.
What was the name of that module we wrote and deleted about 3 months ago? windowing-something?
git log --all --pretty=format:" " --name-only | sort -u | grep -i window
In this example 'git' is the user name and the output format is YAML but you can change this to XML or JSON, eg: curl http://github.com/api/v1/json/usernamehere Show Sample Output
In this example we search for 'vim' but vim doesn't have a project on github right now. That's ok, this command still searches for every project that has 'vim' in their description (forks, plugins, etc). To get XML or JSON output just replace 'yaml' in the url with 'xml' or 'json'. Show Sample Output
Uses line-porcelain in git blame, which makes it easier to parse the output.
This command will automatically find the latest version of the file that was deleted and restore it to it's previous location. If, of course, your file was kept in a git repository... I found this command on http://stackoverflow.com/a/1113140
Generate a changelog between the v1 and v2 tags Show Sample Output
https://git.kernel.org/cgit/git/git.git/commit/?id=ad5aeeded3295589b2573b143f754762a56f8f82
You'll probably want to pass in the -rf options if you have to delete a directory or something.
Delete all your branches except master (useful after archiving branches) Show Sample Output
Print a git log (in reverse order) giving a reference relative to HEAD.
HEAD (the current revision) can also be referred to as HEAD~0
The previous revision is HEAD~1 then HEAD~2 etc.
.
Add line numbers to the git output, starting at zero:
... | nl -v0 | ...
.
Insert the string 'HEAD~' before the number using sed:
... | sed 's/^ \+/&HEAD~/'
.
Thanks to bartonski for the idea :-)
Show Sample Output
Only shows files with actual changes to text (excluding whitespace). Useful if you've messed up permissions or transferred in files from windows or something like that, so that you can get a list of changed files, and clean up the rest.
git log --format=%H | tail -1 doesn't work anymore Show Sample Output
Great way to quickly grasp if a locally cloned repository originates from e.g. github or elsewhere. Show Sample Output
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: