Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homeshick tracked contents of a subdirectory despite its exclusion in .gitignore #130

Closed
absorber opened this issue Jan 21, 2015 · 3 comments

Comments

@absorber
Copy link

I have a ~/.maindir/ which I want to track, except for the contents of ~/.maindir/logs/.

For this reason, I have created a ~/.maindir/.gitignore file. In it, there's simply 1 line: logs/** (As per instructions of ProGit).

However, when I do homeshick track mydotfiles .maindir, it simply tracks the contents of ~/.maindir/logs/ despite my instructions in ~/.maindir/.gitignore.

@andsens
Copy link
Owner

andsens commented Jan 21, 2015

The .gitignore should be part of the mydotfiles repository and not located in the folder in which you are trying to track files.

btw.: depending on globbing logs/** might not match hidden files (i.e. dotfiles), it'd be better to ignore /home/logs (the first slash means "start from the git project root").

@andsens andsens closed this as completed Jan 21, 2015
@absorber
Copy link
Author

Ah I see, but the problem still appears to be persisting.

I went ahead and made a directory and the gitignore file like so .homeshick/repos/mydotfiles/.maindir/.gitignore, with the contents being /home/.maindir/logs then in my ~ as cwd I issued homeshick track mydotfiles .maindir but it still decided to copy the logs subdir.

Is this intended behavior?

@andsens
Copy link
Owner

andsens commented Jan 21, 2015

You should probably read up on how .gitignore works. The .gitignore needs to be at the root of the gitdir or at least in a parent directory of what you are trying to ignore. ...repos/mydotfiles/.maindir is wrong it should be ...repos/home/mydotfiles/.maindir, inside that you can place a .gitignore.
I am not entirely certain whether the leading / actually means "from the git root" or "from the dir this gitfile is in".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants