git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gelonida N <gelonida@gmail.com>
To: git@vger.kernel.org
Subject: two branches: keep one difference but  merge others forth and back
Date: Sun, 27 Nov 2011 18:31:42 +0100	[thread overview]
Message-ID: <jats5v$r7c$1@dough.gmane.org> (raw)

Hi,


Is this possible.


I'd like to have two branches.

If possible I would be able to merge forth and back between both of them.

However I would like, that certain differences will be kept between both
branches.

Is there any way to tell git to permanently ignoring certain commits
from merging?


Example:
---------
   Normally shell scripts would have a first line of
'#!/bin/bash',
but in a certain branch I would like that the first lines would be

'#!/usr/local/bin/bash'

All from then on however I'd like to be able to commit on both branches
and to merge from the other branches (and always keep this difference)

What I tried:
-------------
My first naive approach was:
- create shell scripts in master,
- create then a branch named 'my_shell'
- modify first lines of shell scripts in this branch and commit
- checkout master
- merge my_shell to master with merge strategy 'ours'
  git pull my_shell -s ours
- now I changed something else in master
- when I try to merge back to branch my_shell I will not only get
  the most recent changes done in master, but I will also undo the
changes in line 1 of my shell scripts.

So it seems I am not doing things as one should.


Potential other strategies:
----------------------------
- never commit anything on branch my_shell and just pull regularly
  from master to keep it synced.

- commit changes / bug fixes also on branch my_shell, but NEVER merge
back to master. If a change grom my_shell is really needed on master,
then just cherry-pick.


Thanks in advance for suggestions how you would deal with such 'situations'

             reply	other threads:[~2011-11-27 17:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-27 17:31 Gelonida N [this message]
2011-11-28 15:25 ` two branches: keep one difference but merge others forth and back Carlos Martín Nieto
2011-11-30 12:37 ` Tor Arntsen

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

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

  git send-email \
    --in-reply-to='jats5v$r7c$1@dough.gmane.org' \
    --to=gelonida@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.
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 NNTP newsgroup(s).