git-commit

How do I see a commit's path through git history, or “how it got in the current branch”?

强颜欢笑 提交于 2019-12-20 14:55:55
问题 I'm looking in the commit history using gitk and git log and I'm trying to see how a specific commit arrived in a certain branch. I can see the commits in the history, so I know they are there. What I want to understand is how they got merged (they were supposed to remain on their own branch). This is a very large project and there are hundreds of commits between the commit in question and the current state of the branch, so I cannot clearly decipher through the limited DAG in gitk , and the

How can I fix git commit error “Waiting for your editor to close the file…” with VS Code?

与世无争的帅哥 提交于 2019-12-20 09:15:36
问题 I'm trying just git commit and Git is giving this message: hint: Waiting for your editor to close the file... /c/Users/AGT/AppData/Local/Programs/Microsoft VS Code/bin/code: line 28: /Code.exe: No such file or directory error: There was a problem with the editor 'code --wait'. Please supply the message using either -m or -F option. I'm using, or trying it, VS Code as default and I got this same message with it opened or closed. Commits done through VS Code or by command git commit -m "Initial

Can I use a scripted commit template for git?

非 Y 不嫁゛ 提交于 2019-12-20 08:59:29
问题 We are working on tickets, and when we use the ticket number in the git commit message on the first line, then the ticket is updated with the commit message. To make things simple we always work on a branch with the commit number. Now I'd like to be presented with a commit message where the ticket number would already be filled in. It must be possible, because the branch is already in the commit template, but in comments which are removed by git. I have scoured the docs and the 'net a couple

How to rollback everything to previous commit

99封情书 提交于 2019-12-20 08:42:23
问题 Recently in a project with multiple people, a commit was made as seen in the image below. Marked in red you can see a commit with the description/comment of 'Merge?'. This commit added numerous files and altered numerous others and was never intended to take place. Using atlassian-sourcetree what do I need to do to roll everything back to the commit highlighted in blue? (I am 8 commits behind as seen in the screenshot.) 回答1: If you have pushed the commits upstream... Select the commit you

How to compare two git branches and filter the differences by commit message?

让人想犯罪 __ 提交于 2019-12-20 07:31:41
问题 I have a release branch named release/X.X.X.X which contains all feature branches I want to deploy to production. The release branch is made on top of master which is the current state of production. On every release day I make sure our release branch contains only those changes planned for the release. I use this command to compare the release and master branch: git log release/X.X.X.X ^master --no-merges . I then manually check the commits for keywords like "SHR-1234" which represent ticket

git - Remove commit before HEAD

痞子三分冷 提交于 2019-12-20 03:27:12
问题 Okay I am new to Git and would like to know how to remove a commit before the HEAD. For instance-: commit foo (This is the HEAD) commit bar (This is what I want to remove) How do I delete commit bar entirely from this branch but keep commit foo ? 回答1: git rebase -i HEAD~2 Will let you interactivly remove the commit git rebase will remove all reference of that commit and change the id of the HEAD commit. Meaning people MAY have issues if they have branched from the old commit git revert

Error related to editor when running git commit?

孤人 提交于 2019-12-19 20:44:09
问题 I get the following error when running Git commit: c:/Program/ Files/ /(x86/)/Notepad++/notepad++.exe: -c: line 0: syntax error near unexpected token `(' c:/Program/ Files/ /(x86/)/Notepad++/notepad++.exe: -c: line 0: `c:/Pr ogram/ Files/ /(x86/)/Notepad++/notepad++.exe \$@\' error: There was a problem with the editor 'c:/Program/ Files/ /(x86/) /Notepad++/notepad++.exe'. Please supply the message using either -m or -F option. What does it mean? How can I fix it? 回答1: I was just running into

GIT Error:- expected committer email '' but found 'karan@xyz.com'

一个人想着一个人 提交于 2019-12-18 12:18:09
问题 Git push is getting rejected with the following error message: expected committer email '' but found 'karan@xyz.com' I have already tried: setting use properties in .gitconfig file. trying git push making different clones of same repository. setting up whole system all together after formatting it. But none has worked. What else can I do to resolve it. 回答1: This doesn't seem like a git limitation, but should be some kind of pre-receive hook on the remote side (the Git repository hosting

Git signed commits - How to suppress “You need a passphrase to unlock the secret key…”

百般思念 提交于 2019-12-18 11:52:56
问题 I changed my global Git configuration to sign all commits. I also use gpg-agent so that I don't have to type my password every time. Now every time I make a new commit I see the following five lines printed to my console: [blank line] You need a passphrase to unlock the secret key for user: "John Doe <mail@gmail.com>" 2048-bit RSA key, ID ABCDEF12, created 2016-01-01 [blank line] Even worse, when I do a simple stash, this message is printed twice , needlessly filling my console (I assume for

Git signed commits - How to suppress “You need a passphrase to unlock the secret key…”

佐手、 提交于 2019-12-18 11:52:06
问题 I changed my global Git configuration to sign all commits. I also use gpg-agent so that I don't have to type my password every time. Now every time I make a new commit I see the following five lines printed to my console: [blank line] You need a passphrase to unlock the secret key for user: "John Doe <mail@gmail.com>" 2048-bit RSA key, ID ABCDEF12, created 2016-01-01 [blank line] Even worse, when I do a simple stash, this message is printed twice , needlessly filling my console (I assume for