tags:

views:

60

answers:

1

I unadvertedly change the permissions of my entire tree and commit that change alone with other content changes.

I use something like :

tar -czf deploy.tar git diff --name-only v1 v2

to generate a tar with the modified files between two tags, the problem is that now because of the permissions change almost all my tree is listed as modified.

Is there a way that i could tell git diff to ignore those files which only has the permissions changed?

+1  A: 

This will tell git to ignore permissions:

git config core.filemode false
Daniel Stutzbach
Maybe this could prevent adding files with changed permissions to a commit, but in my case the files are committed, pushed and tagged, and the command you propose doesn't help me. I guess I'll have to make some kind of bash script to parse the output of git diff to remove the lines about mode changes, and feed the result to tar. Any ideas are more then welcome
Cesar
@Cesar: The command tells git to ignore permissions differences between the index and the working copy. Isn't that what you want?
Daniel Stutzbach
@Daniel Stutzbach: i'm new to git, but the thing is that the differences is between commits. When i do git diff tag1 tag2, it show all the files to which i changed the permissions besides the files with modified content, i just want to find a way to ignore all those 'mode change 664 => 775', I hope I made myself clear
Cesar
@Cesar: Oh! So you've already committed the changed permissions? Sorry, I had missed that part. If you haven't already pushed the changes to another repository or merged them to another branch, I'd suggest amending/rebaseing the commit to fix it.
Daniel Stutzbach