1

I'm new to Git, so please bear with me!

I'm working with a clone of a remote repository on Unfuddle. The clone is of an ExpressionEngine install, so I need to make changes to certain files to get the CMS to work on my local machine, I'm running it under MAMP. However, I do NOT want to push these modified files back up to the remote repository when I'm done, nor do I want them sitting in Tower, waiting to have their changes committed.

I've tried ignoring the files, but this causes issues...the ignores get pushed up to the repository, which I also don't want! Other people are working with this repository, and those files should NOT be ignored on their systems. I just basically want Tower to leave the remote repository as-is, but pretend the changes I've made to my local files just aren't there.

Am I asking for the impossible?

-UPDATE- Specifically, I'd like to work with Tower, so knowing how to perform git commands within that framework would be most helpful.

skaffman
  • 398,947
  • 96
  • 818
  • 769
Kate
  • 120
  • 3
  • 13
  • sorry i just confused, so are you using git right now? – TheOneTeam Aug 09 '11 at 16:36
  • You could always ``.gitignore`` your ``.gitignore``s. – BishopRook Aug 09 '11 at 16:37
  • 1
    possible duplicate of [How to tell git to ignore all further edit to a single file without removing it from the repo](http://stackoverflow.com/questions/4114163/how-to-tell-git-to-ignore-all-further-edit-to-a-single-file-without-removing-it-f) – Karl Bielefeldt Aug 09 '11 at 16:42

4 Answers4

3

Use git update-index --assume-unchanged on the tracked files. This is like a "temporary ignore" for tracked files. This will also only apply to your clone and not any one else's

http://www.kernel.org/pub/software/scm/git/docs/git-update-index.html

Also, in the case of untracked files, it is not necessary that you have to use .gitignore to ignore them which makes the ignore propagated to any clone of the repo. You can use $GIT_DIR/info/exclude file to ignore untracked files, only in your repo.

manojlds
  • 290,304
  • 63
  • 469
  • 417
  • I think `git update-index --assume-unchanged` might be what I'm looking for! Testing shortly. – Kate Aug 09 '11 at 16:52
  • Okay, VERY dumb question: I'm using Tower. Does anyone know how to do these sorts of commands in Tower? – Kate Aug 09 '11 at 17:14
  • Do not use `--assume-unchanged` If you actually change the file you are lying to git and that never ends well. If changes to that file come in very bad things will happen. – Seth Robertson Jul 19 '12 at 00:14
2

There's an exclude option in Tower that doesn't use gitignore

  1. Right click the file
  2. Click Ignore
  3. Deselect "Untrack files"
  4. Select "Only ignore locally"
  5. Press save.

To view all the excluded files/folders: go to Settings OR File -> Edit excluded file patterns.

Source: http://www.git-tower.com/files/applicationHelp/pgs/Browse_IgnoringFiles.html

Yaz
  • 1,064
  • 8
  • 15
0

Git only applies ignore patterns to untracked files. You can't use ignore patterns to ignore changes to files that are already tracked by git. Still, see https://gist.github.com/1423106 for ways people have worked around the problem. This is for native git, tower may offer something different as yaz suggested.

Seth Robertson
  • 30,608
  • 7
  • 64
  • 57
0

Based on your description. I guess you don't want your files contaminates your remote repository but you still want to push your file on your server.

There is a concept in git that you can make branch on your local/remote repository.

After you make a branch on your repository, you can push whatever code/file you want. Other developers should not use your branch and they won't get your codes/files.

TheOneTeam
  • 25,806
  • 45
  • 116
  • 158