我目前正在使用以下Gitediff指挥系统,以改变档案清单。 我想排除某些文件夹(datafiles
)和文档()。 DSstore
。 是否有办法这样做?
git diff --no-index /Users/USERNAME/Documents/FWintegration/ingo2/ukon_4355c1 /Users/USERNAME/Documents/FWintegration/ingo2mirror/ingo2mirror
我目前正在使用以下Gitediff指挥系统,以改变档案清单。 我想排除某些文件夹(datafiles
)和文档()。 DSstore
。 是否有办法这样做?
git diff --no-index /Users/USERNAME/Documents/FWintegration/ingo2/ukon_4355c1 /Users/USERNAME/Documents/FWintegration/ingo2mirror/ingo2mirror
Okay...my第三次回答。 不幸的是,这是--no-index
:
git diff | awk {if (/^diff --git/) {if (/d1/S*$/){display=0}else{display=1}};if (display==1) {print}}
每一文档都以“diff - git”为起点。 因此,我们非常看着这条线。 如果它发现它,那么它就停止印刷,直到它发现一个iff子。
So, the only part of the awk statement you modify is if (/d1/S*$/)
This is how it filters...if this regular expression matches, it ll ignore this diff--not print it). This filters out "d1/" followed by any number of non-whitespace characters up until the end of the line (so it s looking at the 2nd filename only and not the first.) For your example, you d want the if to be:
if (/datafiles/S*$/ || /.DSstore$/)
EDIT: If this is too insane for you, and no one provides a better solution, I d highly recommend checking out "Beyond Compare" which is a crazy powerful directory/file comparison tool with a nice UI.
git diff -- :!unwantedpath
For example, git diff -- :!foo/bar/datafiles :!*.DSstore
.
但它是一个相对较新的特点,因此只有在你使用新的Gite版本时才会发挥作用。 我不记得介绍过哪一个版本,但是,在2.10.0之后,它有了一个版本。
Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...
I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...
I have a svn repo with various apps as subdirectory of a single svn repo. That worked because I could have checked out a partial, repo. As I cant do that with git obviously I need multiple repos. I ...
I understand how to merge branches together in git, and I love how easy it makes it. I have a branch that looks like this: project/ |--subproj1/ | |---(files) | |--subproj2/ |---(files) A ...
We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...
I get this on every git svn command I try. I am using git version 1.6.4.2 on OS 10.6 The initial git svn fetch works, and i can do further fetches after that, but they do not enter the log or update ...
Given I have a master branch and a other branch. In the other branch are files I don t want to commit (e.g. log files) so I ignored them in .gitignore. When I switch to the master branch, these ...
Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...