git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: .gitignore is not enough

From
HWHilco Wijbenga <hilco.wijbenga@gmail.com>
Date
Aug 3, 2023, 05:35 UTC
Message-ID
<CAE1pOi1Zt8i_rVi6dCGVsshhPxa_kV7qQ7SMu6R4nsSiadq7xw@mail.gmail.com>
In-Reply-To
<CA+sf2-+499Nfu00ciJeLwjRmBE7Bb-WZcZuCXY2-JXs88Pwz-w@mail.gmail.com>

I think you might be looking for "git update-index --assume-unchanged <file>"? See https://www.git-scm.com/docs/git-update-index for more details.

This allows you to tell Git to ignore the changes you made to that (tracked) file.

On Wed, Aug 2, 2023 at 10:16 PM Aleem Zaki <aleemzaki@gmail.com> wrote:
Show 23 quoted lines
>
> There are files which one would like to pull from a remote branch but
> not have git register said person's changes on said files
>
> Let's have a file named:
> .gitpullfromremotebutdonotregistermylocalchanges
>
> Of course, we can think of a better name
>
> By register I mean detect, like when git status detects changes that
> are not staged for commit
>
> Use case:
>
> On GitHub, you clone a repo with a default config file (skeleton)
> You custom the config file with personal tokens and values
> If the config filename was in .gitpullfromremotebutdonotregistermylocalchanges
> Then the following don't have to be worried about:
> 1. The developer (the remote branch maintainer) doesn't have to not
> have a default config file (skeleton) because it was in .gitignore
> 2. Pushing your secrets
> --
> Anonymous
Previous: Aleem ZakiNext: Johannes Sixt
Message 2 of 8 in “.gitignore is not enough”
  1. Aleem ZakiAug 3, 2023
  2. Hilco WijbengaAug 3, 2023
  3. Johannes SixtAug 3, 2023
  4. Hilco WijbengaAug 3, 2023
  5. Johannes SixtAug 3, 2023
  6. Junio C HamanoAug 3, 2023
  7. brian m. carlsonAug 3, 2023
  8. Aleem ZakiAug 3, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.