git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Bannasch <stephen.bannasch@deanbrook.org>
To: git@vger.kernel.org
Subject: can I always ignore a file during a merge?
Date: Wed, 27 Jun 2012 19:39:03 -0400	[thread overview]
Message-ID: <p06240817cc114629c20f@[192.168.1.122]> (raw)

Is there a way to merge from branchA to branchB and from branchB to branchA while completely ignoring changes to a file that is 
tracked and exists in both branches?

---- details ----

I have two branches in my project (master and energy2d)  automatically being built and tested on travis-ci:

   http://travis-ci.org/#!/concord-consortium/lab

When failures in tests occur notifications are sent to emails in a configuration file checked into each branch:

   master:
   https://github.com/concord-consortium/lab/blob/master/.travis.yml

   energy2d:
   https://github.com/concord-consortium/lab/blob/energy2d/.travis.yml

I regularly merge work in the energy2d branch into master and the Google Summero of Code student I am working with regularly 
merges changes in master into energy2d.

I would like to be able to merge both directions while completely ignoring changes in the travis-ci configuration files in each 
branch.

I have tried creating a .gitattributes file in each branch with the following content:

   .travis.yml merge=ours

But when interpreted by the default merge strategy "recursive" this only applies when there are conflicts -- however this 
current difference is not seen as a conflict:

   $ git diff energy2d .travis.yml
   diff --git a/.travis.yml b/.travis.yml
   index 8ea58dc..ec89f91 100644
   --- a/.travis.yml
   +++ b/.travis.yml
   @@ -8,7 +8,8 @@ notifications:
      email:
        recipients:
          - stephen.bannasch@gmail.com
   -      - janikpiotrek@gmail.com
   +      - sfentress@concord.org
   +      - rpk@pobox.com
    language: node_js
    node_js:
      - 0.6

Which means every time we merge the .travis.yml file is updated on the branch we are merging to.

             reply	other threads:[~2012-06-27 23:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-27 23:39 Stephen Bannasch [this message]
2012-07-03  7:38 ` can I always ignore a file during a merge? Jeff King
2012-07-05 19:49   ` Philip Oakley

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='p06240817cc114629c20f@[192.168.1.122]' \
    --to=stephen.bannasch@deanbrook.org \
    --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).