Git Product home page Git Product logo

Comments (8)

aspiers avatar aspiers commented on May 26, 2024 6

The point is that typically when stowing from a package which is a git repo, the .gitignore at the top of that repo is intended only for use within the git repo, and should not be stowed into ~ or /usr/local or wherever the stow target directory is. The only exception is when you want to use Stow to manage ~/.gitignore (say) as a symlink pointing to a file version-controlled with git. In that case, you can set up a .stow-local-ignore just for that git repo which overrides Stow's default ignore list and allows the .gitignore to be stowed. In fact I do exactly that myself: https://github.com/aspiers/git-config/blob/master/.stow-local-ignore

Hope that makes sense, and sorry for the slow reply! Closing for now, but happy to reopen if anything is unclear.

from stow.

fenugrec avatar fenugrec commented on May 26, 2024 1

quoting the first post :

just add --dotfiles in .stowrc , and rename files to dot-gitconfig and dot-gitignore, so as I said this isn't really an issue.

that's how I solved it

from stow.

FWDekker avatar FWDekker commented on May 26, 2024 1

@afrid18 @nineboxes Just create an empty .stow-local-ignore in ~/.dotfiles/git. The point is not to override your global ignore file, but to override Stow's internal default ignore file.

from stow.

fenugrec avatar fenugrec commented on May 26, 2024

and sorry for the slow reply!

Haha no worries I've seen / done worse.

Thanks for the alternate solution, I wasn't aware of .stow-local-ignore.
I still think it's an interesting edge case / typical scenario; next time someone asks it may need to be added to the FAQ !

from stow.

aspiers avatar aspiers commented on May 26, 2024

@fenugrec commented on April 5, 2021 1:09 AM:

and sorry for the slow reply!

Haha no worries I've seen / done worse.

😆 Thanks for your patience!

Thanks for the alternate solution, I wasn't aware of .stow-local-ignore.
I still think it's an interesting edge case / typical scenario; next time someone asks it may need to be added to the FAQ !

Yep, fair point. We don't actually have a FAQ yet, but there is a section on Ignore Lists in the manual. If you have any ideas for how to improve that, I'd be happy to hear them!

from stow.

whompyjaw avatar whompyjaw commented on May 26, 2024

Hmm.. I must not be as savvy as OP, but can't seem to understand the issue. I wonder if I am doing something wrong?

I put my .gitconfig and .gitignore in ~/.dotfiles/git which is vc'd using a normal git repo that makes ~/ as my work-tree (have an alias, similar to the "bare" concept, just not a bare repo basically). This seems to work fine. I think because I set my work-tree to $HOME. So it pulls the gitignore from home. Not my dotfiles. Does that make sense?

from stow.

afrid18 avatar afrid18 commented on May 26, 2024

I don't have .gitignore file in the .stow-global-ignore and yet I am unable to stow it.

Here is my verbose output:

  dotfiles/git/.stow-local-ignore didn't exist
  /Users/imamkhaja/.stow-global-ignore didn't exist
  Using built-in ignore list
    Ignore list regexp for paths:    /(?^:(^|/)(^/\.stow\-local\-ignore$|^/COPYING|^/LICENSE.*|^/README.*)(/|$))/
    Ignore list regexp for segments: /(?^:^(\.git|.+~|_darcs|.+,v|RCS|\.gitignore|#.*#|CVS|\.cvsignore|\.svn|\.#.+|\.hg)$)/
  Ignoring path segment .gitignore

It seems that segments ignore list is the reason, that .gitignore isn't stowing, if I am not worng.

Screenshot 2022-08-21 at 11 34 43 PM

from stow.

nineboxes avatar nineboxes commented on May 26, 2024

Hello there. I also can't stow the .gitignore by eliminating it from the .stow-local-ignore file on the macOS.
@aspiers sorry for bothering you, could you please take a look?

from stow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.