Assumes you are in the branch you want to run the check on. Sub 'develop' for whatever branch you commonly submit PRs to. Show Sample Output
Description by segments delimited by pipe (|) 1. List all git branches 2. Exclude master 3. Trim output and remove display elements such as * next to current branch 4. Repeat branch name after a space (output on each line: branch_name branch_name) 5. Prepend each line with the git tag command 6. Execute the output with bash
For OS X/bsd; probably messy
A great command to assign to an alias, allowing you to git diff the last two commits in git.
Where $1 = author and $2 = mod name
You need to be running a daily build of Minetest (for example from the 'minetestdevs/daily-builds' PPA), or some bleeding edge mods will not work or crash the game.
Update a mod by entering its subdirectory under ~/.minetest/mods and doing
git pull && git submodule update --recursive --remote --init
This is how you can do this without having to use oneline Show Sample Output
The idea is to get the current branch name directly using git symbolic-ref --short HEAD name and not type it manually. Show Sample Output
1. No for-loop, but xargs. 2. Append "--" in git-reset HEAD command to deal with filenames contained leading hyphen/minus sign (-). 3. Add "--porcelain" option in git-status command for easy-to-parse format when scripting. 4. Add "--no-run-if-empty" option in xargs command to prevent you run it twice and accidentally reset all staged changes. 5. Use zero byte (NUL character) as line terminator instead of newline (\n) to make it more robust to deal with filename with whitespaces. pipe#1: git-status. pipe#2: Use "grep" to filter out "non-added" files. pipe#3: use "sed" to Trim out the leading three characters, reserve the filename. pipe#4: xargs + git-reset... p.s. The "HEAD" in git-reset can be omitted . And, maybe, the third part of this shell pipe (sed) has potential to be enhanced.
Uses git grep for speed, relies on a valid she-bang, ignores leading whitespace when stripping comments and blank lines Show Sample Output
Find in which branch a file is committed. % git log --all -- '**/my_file.png' http://stackoverflow.com/a/372970
Useful for looking up and commits that you may have lost during a rebase or when rewriting some history.
We had a number of git tags named similarly to: 2016.12.13.devel.feature 2016.12.14.master.release But we have multiple developers making commits and tags for testing purposes. I wanted to reduce the number of tags that displayed on our cloud hosting server when doing a deployment.
This is useful in teams where developers don't bother to remove branches after merging PR. These branches make it hard to seek for really useful branches, which gives us a nice value of finding and exploring other people's code even before they create PR for it.
For example, if you have a locally hosted git server, plus github, plus gitlab.
Get newest kernel version by parsing the most bleeding-edge Makefile possible. Useful for doing things like writing live ebuilds and/or self-updating PKGBUILDs for testing purposes. Breakdown: * wget -qO - https://raw.githubusercontent.com/torvalds/linux/master/Makefile — retrieve Makefile and pipe to stdout * head -n5 — only the first 5 lines are relevant, that's where all the version variables are grep -E '\ \=\ [0-9]{1,}' — version variables always have an equals sign followed by a number * cut -d' ' -f3 — extract the individual numbers from the version variables * tr '\n' '.' — replace newlines with periods * sed -e "s/\.$// — remove trailing period Show Sample Output
You'll run into trouble if you have files w/ missing newlines at the end. I tried to use
PAGER='sed \$q' git blame
and even
PAGER='sed \$q' git -p blame
to force a newline at the end, but as soon as the output is redirected, git seems to ignore the pager.
If like me you do a lot of front-end coding and you have a lot of clients that asks you some little modifications, then you send the modifications back to them in a zip file while ignoring the .git folder and .gitignore file, then copy this zip into your dropbox and send it back to them. They find out a new bug so, rince and repeat? You get the picture. It can be quite tedious.
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. Show Sample Output
Requires html2text. Print bad, but often funny commit messages from whatthecommit.com Show Sample Output
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. 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: