相关疑难解决方法(0)

如何通过提交消息搜索Git存储库?

我使用提交消息"Build 0051"检查了一些源代码到GIT中.

但是,我似乎无法再找到源代码 - 如何使用命令行从GIT存储库中提取此源代码?

更新

  1. 使用SmartGIT检查版本0043,0044,0045和0046.
  2. 检出0043,并检查其他分支上的版本0051.
  3. 再次检查0043.
  4. 现在,0051已经消失了.

更新

源代码肯定存在,现在需要检查它:

C:\Source>git log -g --grep="0052"
commit 77b1f718d19e5cf46e2fab8405a9a0859c9c2889
Reflog: HEAD@{10} (unknown <Mike@.(none)>)
Reflog message: commit: 20110819 - 1724 - GL: Intermediate version. File version:  v0.5.0 build 0052.
Author: unknown <Mike@.(none)>
Date:   Fri Aug 19 17:24:51 2011 +0100

    20110819 - 1724 - GL: Intermediate version. File version: v0.5.0 build 0052.

C:\Source>
Run Code Online (Sandbox Code Playgroud)

更新

使用以下内容检索丢失的源代码:

C:\Source>git log -g --grep="0052"
commit 77b1f718d19e5cf46e2fab8405a9a0859c9c2889
Reflog: HEAD@{10} (unknown <Mike@.(none)>)
Reflog message: commit: 20110819 - 1724 - GL: …
Run Code Online (Sandbox Code Playgroud)

git git-log

761
推荐指数
10
解决办法
34万
查看次数

我在 GitHub 上开发了一个私人仓库,然后将其公开。我可以让我的活动可见吗?

我有一个私人仓库,工作了 6 个月。今天我提交论文后终于公开了。是否可以使活动(那些绿色方块)可见?我尝试单击contribution setting并收到消息Visitors will now see your public and anonymized private contributions,但活动仍然不显示。

更新1:

我注意到只记录了我在 GitHub(网站,而不是从我的机器推送代码)上所做的更改。也就是说,仅readme显示我经常在网站上更新的文件。

更新2:

我跑去git --no-pager log -s --format="%ae"查看哪些电子邮件用于提交,并得到以下信息:有些电子邮件是primaryGitHub 下的电子邮件,有些是43555163+Penguin@users.noreply.github.com,有些是Penguin@Penguin-MacBook-Pro.local,有些是Penguin@econ2-204-32-dhcp.int.university_name.edu

另外,正如我在下面的评论之一中提到的,如果我转到我的存储库并专门查看提交,我可以看到类似以下内容的内容Penguin authored and Penguin committed on May 27 1 parent 1d71ac3 commit cb95c2870de67383ee653849b4c7b40a062f5fd3:但这并没有显示在我的活动中。

最后,一些评论提到在 GitHub 上创建一个新的存储库并推送我之前的提交(在以某种方式过滤电子邮件之后,我不太明白)。然而,我已经Stargazers在这个仓库上有几个并且想保留它们。通过创建一个新的仓库,我相信这些将会消失。

更新3:

我曾经git filter-repo将所有电子邮件更改为我的主要电子邮件,现在当我致电时,我以前的所有提交电子邮件似乎都是我的主要电子邮件git --no-pager log -s --format="%ae"。但是,我仍然没有看到活动显示。例如,如果我转到我的存储库,我可以看到其中一项提交显示Penguin authored and Penguin committed on Apr 8,但这不会在活动中显示。

github repo

16
推荐指数
1
解决办法
3410
查看次数

标签 统计

git ×1

git-log ×1

github ×1

repo ×1