you can use .git/info/exclude instead of .gitignore to ignore files only for your clone.

My personal use case for this is customizing the tagline to "The world's first ActivityPub-federated Git service!" without having to worry about accidentally committing it to my current Gitea PR.

Nice !

Can it be used to have a clone of 2 repos in the same folder? I don't remember why I was interested in that question at some point 😅

Next, maybe one can write a "addclone" command that clones a second project in the same folder, making it so that each repo ignores the other's files.

And that raises a question : what happens when a file is committed upstream that has the same name as one that is locally ignored?

@liwott For your question of cloning two repos in the same folder, git subtrees or submodules would work well. Cloning the two repos to the *exact same folder* would be a absolute mess though, since they would mess up each other's .git folders.

As for what happens when a locally ignored file is committed upstream, I'm not exactly sure what happens, but it happened to me once and I had to run `git update-index --assume-unchanged` to ignore the file again.

Sign in to participate in the conversation

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!