[email protected] writes:

> Hi,
>
> Let's say I have a local git server and a remote service such as
> Bitbucket/Github/Gitlab etc.
>
> Let's say I've got a few files in the repository holding sensitive
> information (e.g. "config" files containing passwords etc.)
>
> Is there a way to do a selective push to the remote service ? (i.e. a
> sort of .gitignore type thing, but not gitignore because the config
> files should still be commited to the local repository to enable dev
> testing).

I've sometime felt a need for this too, but git doesn't support it (and
probably shouldn't, I need to rethink my approach instead).

One thing I've sometimes done, when it's a short-term need, is use the
stash. That is, I never check in local config stuff, and stash it away
before a push. It's a pain, but it'll work in a bind.

Another I've used for slightly longer-term things is create a specific
change containing all local config. I then use rebase extensively to
ensure that change always is at the tip of my working branch. Then I
ensure I always push HEAD~1. Also a pain, but it's workable.

If the config stuff is per-user you might find the filter attribute
useful. It lets you run files through a 'smudge' filter on checkout and
a 'clean' filter when staging.

/M

--
Magnus Therning              OpenPGP: 0x927912051716CE39
email: [email protected]   jabber: [email protected]
twitter: magthe               http://therning.org/magnus

The brain is a wonderful organ.  It starts working the moment you get
up and does not stop until you get into the office
     — Robert Frost

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: PGP signature

Reply via email to