Git number of commits per author on all branches
git shortlog -s -n –all –no-merges Will give you statistics for all branches. EDIT: Added –no-merges to exclude statistics from merge commits.
git shortlog -s -n –all –no-merges Will give you statistics for all branches. EDIT: Added –no-merges to exclude statistics from merge commits.
This is a classic case of rebase –onto: # let’s go to current master (X, where quickfix2 should begin) git checkout master # replay every commit *after* quickfix1 up to quickfix2 HEAD. git rebase –onto master quickfix1 quickfix2 So you should go from o-o-X (master HEAD) \ q1a–q1b (quickfix1 HEAD) \ q2a–q2b (quickfix2 HEAD) to: … Read more
git blame -L 10,+1 fe25b6d^ — src/options.cpp You can specify a revision for git blame to look back starting from (instead of the default of HEAD); fe25b6d^ is the parent of fe25b6d. Edit: New to Git 2.23, we have the –ignore-rev option added to git blame: git blame –ignore-rev fe25b6d While this doesn’t answer OP’s … Read more
Essentially you have to have admin rights (directly or indirectly) to the repository to do this. You can either configure the repository to allow all users to do this, or you can modify the log message directly on the server. See this part of the Subversion FAQ (emphasis mine): Log messages are kept in the … Read more
To reference a commit, simply write its SHA-hash, and it’ll automatically get turned into a link. See also: The Autolinked references and URLs / Commit SHAs section of Writing on GitHub.
git checkout -b NEW_BRANCH_NAME COMMIT_ID This will create a new branch called ‘NEW_BRANCH_NAME’ and check it out. (“check out” means “to switch to the branch”) git branch NEW_BRANCH_NAME COMMIT_ID This just creates the new branch without checking it out. in the comments many people seem to prefer doing this in two steps. here’s how to … Read more
Ideally your .gitignore should prevent the untracked (and ignored) files from being shown in status, added using git add etc. So I would ask you to correct your .gitignore You can do git add -u so that it will stage the modified and deleted files. You can also do git commit -a to commit only … Read more
The other answers suggesting checking out the other branch, then committing to it, only work if the checkout is possible given the local modifications. If not, you’re in the most common use case for git stash: git stash git checkout other-branch git stash pop The first stash hides away your changes (basically making a temporary … Read more
Since Git 1.7.9 you can also use git commit –amend –no-edit to get your result. Note that this will not include metadata from the other commit such as the timestamp or tag, which may or may not be important to you.
You can do an interactive rebase and choose edit for the commit whose date you would like to alter. When the rebase process stops for amending the commit you type in for instance: git commit –amend –date=”Wed Feb 16 14:00 2011 +0100″ –no-edit P.S. –date=now will use the current time. Afterward, you continue your interactive … Read more