14 questions
1 vote
1 answer
128 views
Git alias to rebase onto commit before message
Here's a common workflow: Make some changes and commit, e.g. git commit -m 'add action buttons' Make a bunch of interim commits Realize I want to fix that first commit Search for the commit SHA in ...
6 votes
3 answers
2k views
Get MERGE_HEAD in pre-merge-commit hook
In pre-merge-commit, I need the hash of the merge head to verify a few things about the commits that are about to be merged to the current branch. However, it seems that neither the reference ...
0 votes
0 answers
1k views
How to build from a specific git revision in Jenkins
I have a Jenkins build job with Source Code Management > GIT > Repository URL: https://GitHub_repo_url/branch_name this will pull the the HEAD revision out of the branch. How can I pull code of ...
1 vote
0 answers
933 views
git log extension in VSCode throwing error ambiguous argument 'HEAD'
One strange issue i am facing is git history extenstion in VSCode throwing me error that - ambiguous argument HEAD if i select a file and click on git history extension button to see the history on ...
1 vote
0 answers
307 views
git log - exclude children/descendants of given ancestor/base
In git help log and git help revisions, it is documented how to include or exclude specific commits/refs and their ancestors in git log. I am now looking for a way to exclude children of a given rev, ...
2 votes
1 answer
29 views
Referring to the commit prior to a commit specified using `:/` syntax?
The most recent commit whose commit message contains "foo" is spelled :/foo, as in: git show :/foo How does one refer to the parent of that commit? :/foo^ is incorrect; that results in: fatal: ...
4 votes
1 answer
846 views
passing $SOURCE_COMMIT to Dockerfile commands on docker hub
I am building docker image for a service at hub.docker.com. During compilation, the commit hash of the source is passed as an argument to CMake (so that it can be embedded in the version information). ...
3 votes
1 answer
2k views
Refer to a git commit by commit message headline
How can I refer to a git commit by the text / words in its commit message headline? I want to avoid: Mouse copy / paste of a commit hash from git log Typing of commit hexadecimal digits
0 votes
0 answers
64 views
Git revision id and date stay the same for all files
I am iterating over a git repo, or sub repos recursively and I want to output (along with other details) the revision id of the latest commit (aka most recent) of when a file was modified. My problem ...
3 votes
2 answers
91 views
Git commit revision id to be five chars long when using pretty format in Ruby script
My code is the following system('git log --pretty=format:[%h]: %an') where %h gives the revision id of the commit, and it is seven characters long and %an is the author name. My problem is that I ...
6 votes
4 answers
3k views
Is there a way to refer to a child commit of the current detached HEAD?
I know how to refer to a parent commit as HEAD^. But is it possible to refer to a child commit in a similar way?
1 vote
2 answers
229 views
What is the command for "show me all logs from HEAD to ec9cb4106"?
I need to see either (1) log messages from HEAD to ec9cb4106 or (2) rollup diff from HEAD to ec9cb4106. The revision selection page does not appear to discuss it, and I can't get git to accept the ...
11 votes
2 answers
3k views
Getting git-revision hash with webpack
I'm trying to create archive with webpack with suffix by git-revision. Could you tell me please what is good way to do it?
67 votes
4 answers
194k views
Git: difference between "git rebase origin/branch" and "git rebase origin branch"
Does anyone know what is the difference? Seems to me, it is the same. But when I run it, it didn't do the same thing: git rebase origin/branch - ok rebases from remote branch git rebase origin ...