git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Hilco Wijbenga <hilco.wijbenga@gmail.com>
To: Aleem Zaki <aleemzaki@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: .gitignore is not enough
Date: Wed, 2 Aug 2023 22:35:46 -0700	[thread overview]
Message-ID: <CAE1pOi1Zt8i_rVi6dCGVsshhPxa_kV7qQ7SMu6R4nsSiadq7xw@mail.gmail.com> (raw)
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:
>
> 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

  reply	other threads:[~2023-08-03  5:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03  3:23 .gitignore is not enough Aleem Zaki
2023-08-03  5:35 ` Hilco Wijbenga [this message]
2023-08-03 17:17   ` Johannes Sixt
2023-08-03 17:49     ` Hilco Wijbenga
2023-08-03 20:27       ` Johannes Sixt
2023-08-03 21:53         ` Junio C Hamano
2023-08-03 21:38     ` brian m. carlson
2023-08-03 21:47       ` Aleem Zaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAE1pOi1Zt8i_rVi6dCGVsshhPxa_kV7qQ7SMu6R4nsSiadq7xw@mail.gmail.com \
    --to=hilco.wijbenga@gmail.com \
    --cc=aleemzaki@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).