在提交后,是否有办法在线编辑 GitHub.com
中的承诺信息?
从指挥线,人们可以做到
git commit --amend -m "New commit message"
如下问题正确建议:
尝试 git pull
和 git push
有效( 没有任何其它行为干扰平均时间 ) 。
但能否通过GitHub
网站完成?
在提交后,是否有办法在线编辑 GitHub.com
中的承诺信息?
从指挥线,人们可以做到
git commit --amend -m "New commit message"
如下问题正确建议:
尝试 git pull
和 git push
有效( 没有任何其它行为干扰平均时间 ) 。
但能否通过GitHub
网站完成?
不, 这是无法直接实现的 。 每个 Git 承诺的杂件也是根据承诺信息计算的 。 当您更改承诺信息时, 您会更改承诺信息 。 如果您想要强制实施承诺, 您必须强制实施( git push - f ) 。 但是, 如果有人已经拉动了您以前的承诺, 并根据承诺启动了一项工作, 他们就必须将自己的工作重新定位在您的新承诺上 。
git commit --amend
and press Enter.git push --force origin example-branch
command to force push over the old commit.资料来源:https://help.github.com/articles/search-a-commit-message/
您需要使用 git push -f
的假设, 假设以前没有人拉过其他任务。 请注意, 您正在改变历史 。
For intellij users: If you want to make changes in interactive way for past commits, which are not pushed follow below steps in Intellij:
希望有帮助
否,因为承诺信息与承诺SHA/hash有关,如果我们改变它,承诺SHA也会改变。我所用的方式是就承诺提出评论。我无法反感。
for Android演播室/Intellij 用户:
有人要求我修改我在Github上提交的贴补丁信息, (最后还是在这里)。这就是我为完成任务所做的。
git clone [email protected]:YOURNAME/EXAMPLE.git; cd EXAMPLE; git fetch --all; git pull --all
git checkout -b patch-2 origin/patch-2 # create local patch-2 branch
git commit --amend # update the commit message
git push -f
这对分支上的最后一项承诺有效。 如果相关承诺的深度更大, 您需要做一些更复杂的事情 。 (我不知道是否需要获取和拉动, 但我只是在做其他工作以节省时间时通过这条线 。 )
我正面临同样的问题
以你的项圈为分支,你将知道那个分支中第一个被约束者的模样。你应当谨守下列律例:
git rebase -i <Commit SHA of first commit>
编辑器会打开。 使用 Github 界面和打开编辑器跟踪您的承诺, 并更改信件 。
视觉演播室用户 <强>: 强>
You are able to modify the commit message from the commit tab by clicking Unpushed Commit (1) and the View Outgoing/Incoming option (2). Then, once comment is modified (3), Amend Message option (4) is enabled and changes are performed automatically in the commit.
Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...
I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...
I have a svn repo with various apps as subdirectory of a single svn repo. That worked because I could have checked out a partial, repo. As I cant do that with git obviously I need multiple repos. I ...
I understand how to merge branches together in git, and I love how easy it makes it. I have a branch that looks like this: project/ |--subproj1/ | |---(files) | |--subproj2/ |---(files) A ...
We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...
I get this on every git svn command I try. I am using git version 1.6.4.2 on OS 10.6 The initial git svn fetch works, and i can do further fetches after that, but they do not enter the log or update ...
Given I have a master branch and a other branch. In the other branch are files I don t want to commit (e.g. log files) so I ignored them in .gitignore. When I switch to the master branch, these ...
Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...