我将 Visual Studio 2015 与 Git 集成一起使用。我想要实现的是回到特定代码行的历史中。
我知道有 Source Control > Annotate。但后来我只能看到最新的变化。然后,我可以右键单击注释装订线上的行并说“注释此版本”,这将为我提供该特定行的最新更改。但是从那里开始,如何回到那条线的历史?“注释此版本”显示为灰色...
我们厌倦了掉毛。所以我们想在我们的项目中使用黑色。不幸的是,它几乎改变了我们项目中的所有其他行,这会使我们丢失大部分作者信息。我们annotate在 pycharm 中使用或git blame很多来确定在查看特定代码片段时与谁交谈。在一次提交中更改大量文件时,如何保留这些信息?
编辑:由于这是这个问题的重复,我想专注于“尽可能好”的方法。
让我们假设 lint 提交是由人工(但已知)作者创建的,因此用作标志。那么是否可以创建一个git blame类似的输出来显示自此关键 lint 提交以来的所有作者以及在该提交中更改的行的任何先前作者?
我意识到这对于拆分/合并的线路效果不佳,但它至少提供了一种更快的方法来限制潜在人员与 1、2、3 人交谈的范围。
如果我git blame在一个文件上运行,它会列出每行的提交、作者修改的特定行。但除此之外我还能怎么责怪,即我想看看谁在 . 中的信息之前更改了这些行git blame。我怎样才能做到这一点?
我最近一直在使用Fugitive的Gblame,但不太明白"reblame"的作用.
有人可以更清楚地描述这些选项的作用:
- reblame at commit
~ reblame at [count]th first grandparent
P reblame at [count]th parent (like HEAD^[count])
Run Code Online (Sandbox Code Playgroud) 我正在使用sonarqube-6.0,我尝试使用示例示例与声纳扫描仪一起运行
当我在声纳扫描仪中运行任何项目时,我得到了责备错误
声纳扫描器配置中的文件Conf是vi sonar-scanner.properties
#
# must be unique in a given SonarQube instance
sonar.projectKey=SonarSource-sonar-examples-8051d9d
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
sonar.projectName=java-maven-simple
sonar.projectVersion=1.0
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# Since SonarQube 4.2, this property is optional if sonar.modules is set.
# If not set, SonarQube starts looking for source code from the directory containing
# the sonar-project.properties file.
sonar.sources=/Users/kingslee/work/software/projects/sonar-scanner-2.8/bin/sonar-examples …Run Code Online (Sandbox Code Playgroud)我想设置git blame --color-by-age为默认行为每当我调用git blame。我将如何配置我的.gitconfig文件来实现这一目标?
为了清理我们的代码,我们想使用 astyle。问题是我们希望有人来完成这项工作,但责怪以前的提交者(代码的真正作者,而不是清理的人)。
有没有办法在 git 中安全地做到这一点?
根据我的理解,该命令git blame应该显示文件中的每一行的作者和最后修改该行的提交。例如,如果我运行git blame -- "<filename>"并获得第 5 行的以下输出:
106b77db (Walrus 2016-03-24 10:01:36 +0800 5) .root {
Run Code Online (Sandbox Code Playgroud)
这意味着该行.root {源自Walrus提交中的作者106b77db。换句话说,如果我检查106b77db使用生成的补丁git show -p 106b77db,我希望该行+.root {显示在差异中。确实如此。
106b77db的 diff的片段<filename>:
/* JavaFX CSS - Leave this comment until you have at least create one rule which uses -fx-Property */
+.root {
+ -fx-background-color: transparent;
+}
+
Run Code Online (Sandbox Code Playgroud)
现在,当我运行git blame -w -- "<filename>"(该-w选项忽略空白更改,即及时向后跟踪每一行以找到对该行引入非空白更改的最后一个作者)时,我现在得到第 5 …
Git提供了自选项
git blame --since=3.weeks -- foo
Run Code Online (Sandbox Code Playgroud)
有没有办法可以得到两个日期之间的责备清单?
那是:类似于git log --since和的东西--until.
该命令git blame --ignore-revs-file .git-blame-ignore-revs add.txt适用于我机器上本地的非裸存储库,但是当我在本地获取同一存储库的裸存储库并尝试相同的命令时,会发生以下情况:
git blame --ignore-revs-file .git-blame-ignore-revs add.txt
fatal: could not open object name list: .git-blame-ignore-revs
Run Code Online (Sandbox Code Playgroud)
还请注意,当我们在位于文件系统其他位置的复制文件中传递相同内容时,它会起作用。例如:git blame --ignore-revs-file /tmp/.git-blame-ignore-revs add.txt工作正常。
我认为这可能是因为它无法找到裸存储库中提到的路径,所以我尝试了类似以下的操作:
git blame --ignore-revs-file -- .git-blame-ignore-revs add.txt
但这导致:
fatal: bad revision '.git-blame-ignore-revs'
谁能帮助我了解如何在针对裸存储库运行 git 命令时将文件路径传递给选项?还是根本不可能?
git-blame ×10
git ×8
blame ×4
git-config ×1
lint ×1
python-black ×1
sonarqube ×1
vim ×1
vim-fugitive ×1