...this command to list the authors of the most recent commit of each branch: git for-each-ref --format='%(committerdate) %09 %(authorname) %09 %(refname)' | sort -k5n -k2M -k3n -k4n

...you select from a list of all started and finishes stories. Then it runs git commit with the generated message (i.e. all staged changes will be commited). When running for...

mislav.uniqpath.com

Random list of useful git commands for advanced users. I found some of them useful...

This will list all branches matching your query as input options for git checkout greckout ar 1) ar/cache-api-keys-1098 2) ar/add-categories-object-to-tv-show-1382...

geewax.org

When we started using git to manage our source code at work, we actually jumped in a little bit too fast. It seems like there is a lot of writing...

...about how you can do lots of really neat things with git, but no real guide about one particular way of using git for your project. This post is going...

linux.die.net

...out which of your local commits are not on the remote server do this: git cherry -v The -v option prints out the commit messages. Without it you will see...

...only the SHA1 codes. You may also compare against another (upstream) branch like that: git cherry -v origin/somebranch This tool is especially useful when you have a ton of commits...

makandra dev

tmp/* storage/* db/*.sqlite3 db/schema.rb db/structure.sql public/system .project .idea/ public/javascripts/all* public/stylesheets/all* public/stylesheets/*.css config/database.yml *~ *#* .#* .DS_Store webrat-*.html

unix.stackexchange.com

As described by the linked Stackoverflow answer, run these commands: sudo add-apt-repository ppa:git-core/ppa -y sudo apt-get update sudo apt-get install git

...This will get you Git 2.6.4 (as of Dec 2015). Troubleshooting If you don't have add-apt-repository yet, install it with: sudo apt-get install python-software-properties...

...can change how many lines are shown above and below a changed section. E.g. git diff -U10 will show 10 lines above and below...

...for your project. Go to Project Settings / Version Control and set the director to Git...

gitready.com

...them into your local branches, etc. You can see the remote branches by saying git branch -r Or, if you want to see both local and remote branches, you can...

teddziuba.com

The problem isn't that Git is to hard, it's that smart developers are impatient and have exactly zero tolerance for unexpected behavior in their tools. While Git is...

blog.plenz.com

If you recorded a bad fix for a conflict, you can tell git to forget that bad resolution: git rerere forget your_file.rb Afterwards, the badly resolved file will still be...

...in your working directory. To get it back with confict markers, say: git checkout -m your_file.rb Resolve the conflict again, properly now...

eagain.net

Quick introduction to git internals for people who are not scared by words like Directed Acyclic Graph. The linked page offers a simple yet concise explanation of how git is...

...a simple diagram, so you get a sound understanding of how each command affects git's structure...

git diff commit_hash -- path/to/file Provide any commit hashes or branch names like "master" for commit_hash...

makandra dev
github.com

Git commands tend to come in groups. Avoid typing git over and over and over by running them in a dedicated git shell. You might want to run git config...

...global help.autocorrect true before using gitsh. This will silently swallow a muscle-memory "git" prefix to your commands inside the git shell...

makandra dev

A nice way to stage absolutely all changes (edits, additions, deletions):

stackoverflow.com

While git branch will show you all branches and highlight the current one with an asterisk, it can be too cumbersome when working with lots of branches.

...the branch you are currently on, use: git rev-parse --abbrev-ref HEAD

blog.avisi.nl

...per default – you may change this, but it won't work for all programs), git won't recognize when you change the casing of files in your repository. Workaround

makandra dev
robots.thoughtbot.com

git command line options for automating common rebasing tasks, like adding a fix to a commit that was already rebased into the history...

makandra dev
stackoverflow.com

...work? There is hope! The linked article tells how to recover from an accidental git reset --hard. On a Mac You will need to install GNU find utils as described...

makandra dev
robots.thoughtbot.com

...and were subsequently abandoned. We decided we wanted to clean up a bit, and git made that easy...

makandra dev
ndpsoftware.com

Make sure you understand differences between git's areas (such as stash, workspace, upstream, etc.) and what commands affect which areas...

makandra dev
stackoverflow.com

When there's a Gemfile.lock in your working directory that you cannot remove by either checkout, reset [--hard], stash, probably...