标签: git-commit

如何通过其 SHA1 哈希改写 Git 提交?

我创建了一个提交,其中包含要修改的提交消息。我还没有发布提交,所以我可以安全地重写历史。我可以使用 git log 找到,所以我知道它的 sha1 哈希值。如何快速编辑提交?

git git-rebase git-commit

3
推荐指数
1
解决办法
1192
查看次数

是否可以将更改推送到 Team City 中的 VCS 根目录?

正如标题所说,

我目前正在 Team City 中运行构建,其中 VCS 根指向 github 存储库。我想运行这个构建,它还会更新我的 github 存储库中的属性文件。我只找到了将工件发布到 Team City 的方法,但是有没有人能够从 Team City 提交并推送到他们的 VCS 根目录?

非常感谢您提前。

teamcity push properties github git-commit

3
推荐指数
1
解决办法
2744
查看次数

git commit 后无法通过评论部分?

在我执行 git commit 后,它会提示我进行评论,以便我可以推送到 bitbucket,通常我按 alt+x,然后退出,然后 git push。但出于某种原因,它并没有让我退出。

committed new changes to bitbucket

Please enter the commit message for your changes. Lines starting
with '#' will be ignored, and an empty message aborts the commit.
On branch master
Your branch is up-to-date with 'origin/master'.

Changes to be committed:
   new file:   blocks/folder-navigation.block
   new file:   blocks/index-album.block
Run Code Online (Sandbox Code Playgroud)

....

git commit git-commit git-bash

3
推荐指数
1
解决办法
6766
查看次数

删除未推送的 git 提交,但保留所有本地工作

我的本地目录中有一些大文件,包含在我认为阻止我的 git push 继续进行的提交中:

Counting objects: 194, done.
Delta compression using up to 4 threads.
Connection to bitbucket.org closed by remote host.
fatal: The remote end hung up unexpectedly
Compressing objects: 100% (190/190), done.
error: pack-objects died of signal 13
error: failed to push some refs to 'myrepo'
Run Code Online (Sandbox Code Playgroud)

至少,我相当确定是文件的大小导致推送失败。我只想删除提交的记录,这样我就可以返回并为这些文件添加一个 .gitignore,提交并再次推送。

一个 git status 给出:

On branch master
Your branch is ahead of 'origin/master' by 3 commits.
  (use "git push" to publish your local commits)
nothing to commit, working directory clean …
Run Code Online (Sandbox Code Playgroud)

git git-commit

3
推荐指数
1
解决办法
5329
查看次数

Git - 旧提交中分支之间的差异

我有这个:

branch: commit 1, commit 2, 3,4
master: commit 1, commit 2, 3,4,5,6,7
Run Code Online (Sandbox Code Playgroud)

你怎么能在分支之后commit 2(在那个历史点上)和主分支之间进行区分commit 3

git diff branch git-diff git-commit

3
推荐指数
1
解决办法
2582
查看次数

GIT:创建具有还原更改的新分支

不小心我在我的主分支上合并了分支,但我不得不恢复更改。我想创建一个新分支并选择我必须还原的所有更改。

你们中的任何人都知道如何使用我的所有预览提交创建分支?

我会非常感谢你的帮助

git github git-commit gitlab

3
推荐指数
1
解决办法
2476
查看次数

是否有可能获得上次 pull 的提交次数?

假设我正在从 repo 中提取更改以更新我的本地存储库。我提取的更改包括 4 次提交。有没有办法获得最近的“git pull”中的提交次数?谢谢!

git git-commit

3
推荐指数
1
解决办法
219
查看次数

如何区分摘要与 TortoiseGit 提交中的描述?

例如,在 Github 上,我们可以在提交中放置摘要消息,但我们也可以放置描述消息,因此当协作者想要查看提交的描述时,他可以了解更多详细信息:

在 GitHub 上提交消息

在 TortoiseGit 中提交消息时我们该怎么做,因为他只给你 1 个输入来编写你的消息?

git tortoisegit git-commit

3
推荐指数
1
解决办法
746
查看次数

删除所有 git 提交的时间和时区,但保留日期

我想删除在存储库中创建的所有提交的时间,尤其是时区信息。那可能吗?如果不是,是否可以简单地将时间00:00和时区设置为+0000
(顺便说一句,我想保留日期。这只是我不想要的时间和时区。)

我只发现了关于更改所有提交的作者的问题,但没有发现关于仅更改所有提交中的属性以保留剩余信息的问题。

是的,我知道人们可以通过其他方式找到我住的地方等,但这对我来说已经足够了。

git git-commit

3
推荐指数
2
解决办法
1392
查看次数

Git:如何在没有以前所有历史记录的情况下挑选提交

我想从我的currentrepo 中的特定提交添加一些特定的更改到我的upstreamrepo。

运行这样的东西: git push upstream <commit SHA>:<remotebranchname>

添加提交加上所有以前的更改

运行类似

git checkout -b new-branch 
git pull <remote> <upstream branch> branch is
git cherry-pick <commit hash>
git push <remote> new-branch
Run Code Online (Sandbox Code Playgroud)

还写入所有以前的更改。

我只想将该提交的特定更改写入upstreamrepo,因此它不包括我的currentrepo 中先前提交所做的更改,这些更改不在upstream.

有很多关于在计算器上的信息的cherry-pickrebase,但没有回答这个非常具体的问题。

git git-rebase git-commit git-cherry-pick

3
推荐指数
1
解决办法
652
查看次数