commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. 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.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
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:
Simpler and without all of the coloring gimmicks. This just returns a list of branches with the most recent first. This should be useful for cleaning your remotes.
Git uses secure hash sums for its revision numbers. I'm sure this is fine and dandy for ultra-secure computing, but it's less than optimal for humans. Thus, this will give you sequential revision numbers in Git all the way from the first commit.
This fixes a bug found in the other scripts which fail when a branch has the same name as a file or directory in the current directory.
Great way to quickly grasp if a locally cloned repository originates from e.g. github or elsewhere.
attempts to delete all local branches. git will fail on any branches not fully merged into local master, so don't worry about losing work. git will return the names of any successfully deleted branches. Find those in the output with grep, then push null repositories to the corresponding names to your target remote.
assumes:
- your local and remote branches are identically named, and there's nothing extra in the remote branch that you still want
- EDIT: you want to keep your local master branch
-u tells git to automatically stage all changes to files in the index (eg. deleted and modified files).
See:
http://stackoverflow.com/questions/1402776/how-do-i-commit-all-deleted-files-in-git
Make sure to run this command in your git toplevel directory. Modify `-j4` as you like. You can also run any arbitrary command beside `git pull` in parallel on all of your git submodules.
Similar, but uses tarball instead of zip file
This will delete the branch 'featureless' on the origin remote.
Do not forget to delete the branch locally using:
git branch -d featureless
'I got it here'-credit:
http://gitready.com/beginner/2009/02/02/push-and-delete-branches.html
I duplicated here incase you stumbled here first.
Fetch comical VC commit messages from whatthecommit.com
Requires html2text. Print bad, but often funny commit messages from whatthecommit.com
Fetch comical VC commit messages from whatthecommit.com
usage:
where COMMIT
for instance:
where 1178c5950d321a8c5cd8294cd67535157e296554
where HEAD~5
Parse the output of git status.
Once the line '# Changed but not updated:' has passed print every last part of the line if it exists on disk.
Based on: http://stackoverflow.com/questions/746684/how-to-search-through-all-commits-in-the-repository
It would be good if anyone can shorten this to eliminate the duplicate query string.
Can anyone make a shorter one?
This doesn't work:
git log --reverse -1 --format=%H
Gets the authors, sorts by number of commits (as a vague way of estimating how much of the project is their work, i.e. the higher in the list, the more they've done) and then outputs the results.