没有通知的Git行被删除 [英] Git lines getting deleted without notice

查看:96
本文介绍了没有通知的Git行被删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个遥控器,当他提交时他一直在删除行,但他们没有出现在git日志中,他是如何删除行,但防止git显示它们的?

I have a remote designed and when he commits he keeps deleting lines but they don't show up in the git log, how is he doing to delete the lines but preventing git showing them ?

让我给你看一个例子:
我在其中一个类中添加了一个边距:0 30px行。几小时后,他的一个提交行被删除:

Let me show you an example: I added a margin: 0 30px line to one of the classes. Hours later after one of his commits the line got deleted:



   DANIEL-PALACIOs-MacBook-Air:Groupy skoda306$ cat public/stylesheets/sass/custom.sass | grep "margin: 0 30px" 

这不会产生输出,但我可以在日志中清楚地看到我添加了行:

This produces no output, but I can see clearly in the log that I added the line


DANIEL-PALACIOs-MacBook-Air:Groupy skoda306$ git log -S"margin: 0 30px" public/stylesheets/sass/custom.sass 
commit 72e32eb415ca2282dffb89f7f6174c0f7136e2d5
Author: Daniel Palacio 
Date:   Sat Apr 9 15:17:39 2011 -0400

    Changed the buy button to make it bigger

但是git从不显示线路何时被删除,他是这样做的?

But git never shows when the line was deleted, how is he doing it ?

抱歉关闭,因为任务太困难而无法理解

Sorry closing as the questing is too confusing to understand

推荐答案

git log -S - 也会显示该特定文本是否为DELETED。所以,就我所知,列出的提交(72e32eb415c)可能恰恰是删除该行的那个:)现在,当然,我相信你检查了这一点,但我想我会提及它。 [1]

git log -S will also show if that particular text was DELETED. So, for all I know, the commit listed (72e32eb415c) might precisely be the one that deletes the line :) Now, of course I'm sure you checked that, but I thought I'd mention it. [1]

我想

I guess

git blame -- /public/stylesheets/sass/custom.sass

应该更清楚一些。如果您知道接近目标的搜索模式,请执行以下操作:

should shed some more light. If you know a search pattern close to the target, do something like

git blame -L/pattern/,+5  -- /public/stylesheets/sass/custom.sass

$ 0.02

[1]这个git包是证明:

[1] this git bundle is proof:

base64 -d > bundle.git <<HERE
IyB2MiBnaXQgYnVuZGxlCjFjYTYyYzg4N2VhNDMxNmRlNTJmMTFmYjgxZTA4OWZlNTA3N2FkOTIg
SEVBRAoKUEFDSwAAAAIAAAAGkQ14nJWLWwrCMBAA/3OK/Atld/MGEe/gCbLJloq2lXS9v3oEfwYG
ZnSI2C4YPZe5OgqlICTK2FNMwLVxBM+Nw5yRzKsO2dQmRsm5z9S9c8iFY6DyrUKPMbTsMyHU6JKp
b132YW+iiz0fssh1FRmPqtNPpu15seiAXPmC7AkIwLR9Xe+q8udmDmn71s0H9rc8+5IKeJyVjMEN
wjAMAP+Zwn+kyklqIksIsQMTpMZRIppWSs3+lBH43T3ubKgCzZKkFOGwMHrPkgqe9Ip8VaI5UV6K
FEouf6zuA55qFW6HVn101fHONv1k2tY7+Ighcjw3cMGA6GTvvZnpn5lrW7OWV/cFxPUwvq0BeJwB
HQDi/zEwMDY0NCBhAPTL8Mk74sG76S9n4/Szffj3AZ6+wwsPlLYBeJxLTCzgysvPL+HKzUwt5qoq
LebKSi3hAgBYlgd4rQF4nDM0MDAzMVFIZJA65rLv7bKXZ0/+XDD91p3gq/99wtQBtMEOe7wBeJxL
TCzgysvPL+HKzUwt5koqyk8t4qoqLebKSi3hAgCOjwmcDdQMPXKLB94u5+xOPu4Y/ZcQw6I=
HERE

做一个克隆并测试它

do a clone and test it

git clone bundle.git bundle
(cd bundle && git log -pSbroer)

会同时显示添加版本的版本d 删除单词'broer'

will show both the revision adding and deleting the word 'broer'

这篇关于没有通知的Git行被删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆