git-log

Which commit hash to undo a pushed merge using git-revert?

拈花ヽ惹草 提交于 2019-12-23 08:45:48
问题 I merged the beta branch into the master branch. I pushed to origin. I now want master to be as it was prior to the merger both locally and remotely. A good answer for undoing a merge that was already pushed suggests git revert -m 1 commit_hash If this is indeed the way to go, how can I determine commit_hash ? I unsuccessfully tried the hash returned by merge-base: $ git merge-base --all master beta 1f4b949b7ef97abf913ae672e3acd0907abfac1b $ git revert -m 1

Limit refs shown with git log --decorate

谁说我不能喝 提交于 2019-12-23 07:42:16
问题 I have 3 standard remotes for a the main repository I work in currently: a local backup, my development partner's workstation, and a hosted repository. We have 3 or 4 branches that are active most of the time, one being master. I monitor the branches on a regular basis throughout the day using: git log --graph --oneline --decorate -15 my-branch his-repo/his-branch master other-branch --decorate is crucial because it lets me know the state of things in regards to our very volatile development

git log --pretty=format windows strange behavior

。_饼干妹妹 提交于 2019-12-23 06:02:18
问题 I reduce the problem to its lowest terms. Under linux a git command like this: git log --pretty=format:{"commit":"%H"} gives me a valid json element, so something like: {"commit":"20cafdecc9898113ac6215ae70cd7622dc2cae3b"} under windows I obtain a not-valid json element, because in some way windows seems to remove the double-quotes elements and I obtain: {commit:20cafdecc9898113ac6215ae70cd7622dc2cae3b} Do you know why, or how can I fix it making it work under both os? Thank you! 回答1: I

How to list only version tags with git-log?

早过忘川 提交于 2019-12-23 03:48:07
问题 I want to create a (latex) table of tags and theirs messages straight out of git, therefor I need to get all tags that match a pattern like: /^v([0-9]|\.)*/ or so. How to do this? My attempt: git log --all --tags --grep="^v([0-9]|\.)*" --pretty=format:"%d & %s & %b" fails and returns nothing (tested on the linux kernel source tree). 回答1: $ git for-each-ref --format='%(objectname)' \ 'refs/tags/v.*' 'refs/tags/v[0-9]*' | \ xargs -n 1 git log -1 --pretty=format:"%d & %s & %b" 来源: https:/

Git and binary files history

非 Y 不嫁゛ 提交于 2019-12-22 11:35:36
问题 This is a follow up on some similar " answered " questions about git handling binary files and how git can't follow file history very well. So, git can't properly follow file history . Heck, even git log --follow -M100% --name-only -- path-to-my-file won't do it, and I'm supposedly telling it to only follow files that are 100% similar! Then we are supposed to use other ways to find who to blame , such as bisecting . Problem here is: those doesn't seem to work with binaries. And accodring to

What flags need to be set on `git log` to make it have similar output to `git whatchanged`?

有些话、适合烂在心里 提交于 2019-12-22 08:19:36
问题 Per: Difference between git-log and git-whatchanged? Encourage new users to use 'log' instead. These days, these commands are unified and just have different defaults. I only recently discovered git whatchanged but found its output: commit deadbeefdeadbeefdeadbeefdeadbeefdeadbeef Author: Egg Sample <mail@example.com> Date: Mon Jan 28 16:32:04 2019 -0800 change some files :100777 100644 abaddad1 feeb1e42 M src/changemymode.txt :100644 100644 1234abcd abcd1234 M src/changemycontent.txt :000000

How can I list all modified files by an author between a commit range but only with the last thing that happened to the file in Git?

梦想的初衷 提交于 2019-12-22 08:16:10
问题 The command: git log --oneline --name-status --author=$AUTHOR $COMMIT_RANGE | grep -vE '[a-fA-F0-9]{5} ' | sort | uniq | cat -n Returns a list of the files modified by an author between a range of commits with the status e.g. M for modified. 1 M a_file 2 M another_file 3 M file 4 D file How can I show only the last thing that happened to the file file , e.g. here it was deleted ( D )? I don't want to see the previous modifications to the file (i.e. the M ), only the last thing that happened

git log over ssh remote repository

给你一囗甜甜゛ 提交于 2019-12-21 06:25:31
问题 I want to create a git (web) browser, hence I need to iterate over commits ( git log ) on remote repository which is on ssh connected machine. My repo is quite big and constantly changing, therefore I will be interested in not fetching changes locally only to git log them. I have tried with: git remote add origin ssh://example.net/repo git checkout -b master --track origin/master and it failed :\ Any hints how to do that? 回答1: You could push the log to the web server using a hook. On the

Configuring git log to use mailmap by default

大憨熊 提交于 2019-12-21 03:27:46
问题 Is there a way to configure git log to use a mailmap file by default? Without having to specify a format (or an alias for one). 回答1: I have Git 2.4.1. If you set log.mailmap config to true, that will set it to work with git log also git config --global log.mailmap true 回答2: You can set up defaults in your .gitconfig file. The documentation says: log.mailmap If true, makes git-log , git-show , and git-whatchanged assume --use-mailmap . This will look for a .mailmap only in the root of the

How does git log --since count?

99封情书 提交于 2019-12-20 08:12:39
问题 I have a simple test repository with just several commits and want to see the date&time filtered log: $ git log --author="automatix" --since="2013-01-30" --pretty -- test commit ea0719bef142659fa561c9d040b2120012ed0184 Date: Thu Jan 31 02:03:12 2013 +0100 commit ab4a8387bc4d9bdb4f67212df77eb1fc3d8b6304 Date: Thu Jan 31 01:59:11 2013 +0100 commit a0b027beba2cd03571bb9475b9db9542f8efe990 Date: Thu Jan 31 01:50:38 2013 +0100 commit add77c8fe2ba9254c11b98e14facede3420dc51c Date: Thu Jan 31 01:48