[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gits] importing code from other sources



	Leigh> So I guess that git does not allow me to branch a specific
	Leigh> file, does it?
	Leigh> 
	Leigh> I have two files that I committed at different times, with the
	Leigh> original code. So they have different commit ids. I want to 
	Leigh> branch those two files at the base, commit the new files from
	Leigh> the tarfile, and then merge in the differences into HEAD.

Without knowing more, my guess is that you want to:

  + Go back in time to a point where the tarfile-derived files didn't exist in
    your repo.

  + Create a vendor branch at that point, and check it out.

  + Unpack the vendor's tarball where you want it, and commit that.

  + Continue to apply further vendor snapshots on that branch.

  + git checkout master && git merge vendor

This won't change the past on master, which might not "make sense" from a "what
are those files doing there" point of view.  And you might need to take care in
the initial merge with the vendor branch.

But at least after this, you will have a shiny vendor branch where you can
track upstream future changes.

(Did this explanation make sense?  I'm always worried that my explanation of
git things don't make any sense, and I don't realize it.)

Eric.

-- 
-------------------------------------------------------------------------------
Eric Eide <eeide at cs.utah.edu>  .         University of Utah School of Computing
http://www.cs.utah.edu/~eeide/ . +1 (801) 585-5512 voice, +1 (801) 581-5843 FAX