忽略了git的承诺一定的变化 [英] Ignore certain changes for git commit

查看:119
本文介绍了忽略了git的承诺一定的变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的团队成员使用不同版本的Visual Studio,并VS似乎自动更新SLN文件code这样的:

Members of our team uses different version of visual studio, and VS seems to automatically update the sln file with code like:

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C# Express 2010

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012

每当我们与解决方案合作。我们可以配置混帐忽略这样的变化?我们无意在这条线,但我们感兴趣的.sln文件的其他变化,如的新的csproj加入到该溶液中。

whenever we work with the solution. Can we configure git to ignore such changes? We're not interested in this line, but we are interested in other changes of the .sln file, e.g. adding of new csproj to the solution.

推荐答案

您可以添加涂抹/清洁过滤器混帐它调用的脚本来调整特定的行承诺的时候是一致的。在<一href="http://stackoverflow.com/questions/2316677/can-git-automatically-switch-between-spaces-and-tabs/2316728">Can git的空间和标签之间自动切换?,它展示了如何实现一个类似的变化,其中的空格转换为选项卡结账,并返回到空间上提交。

You can add a smudge/clean filter to git which calls a script to tweak the particular line to be consistent when committing. In "Can git automatically switch between spaces and tabs?", it shows how to implement a similar change, where spaces are converted to tabs on checkout, and back to spaces on commit.

您可能会需要编写脚本来识别和修改相关行,而链接的例子使用pre-现有的UNIX的制表符和空格之间交换命令。

You'll probably need to write the script to identify and modify the relevant line, whereas the linked example uses pre-existing unix commands for swapping between tabs and spaces.

这篇关于忽略了git的承诺一定的变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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