I think... You should create a personal branch ("samples") that can hold your 
local sample files, with full history. It could be an orphan branch if you 
want, so that it does not have any of the main code.

You can then use a regular git merge of your files to the upstream files that 
have been pulled into the main repo. You may find that you want to start a 
personal branch ("myversion") from the tip of the usptream 'master' (I assume 
it is named 'master'). That way you checkout myversion" and then merge 
"samples" and now have a personal local version of the upstream.

The hard step is being brave enough to start that first (personal) branch and 
commit your samples (nothing breaks!!), and the subsequent branches, merges and 
commits. 

Use the 'gitk' viewer or 'git log --graph' to see how it is all arranged.

--
Philip


PS, to help learn, why not use the 'git fetch' / 'git merge' version of 'pull' 
so you can see better what is going on. In some case the pull command is not 
appropropriate for the/your workflow.
  ----- Original Message ----- 
  From: Mathieu Bahin 
  To: Git for human beings 
  Sent: Wednesday, December 14, 2016 2:07 PM
  Subject: [git-users] git merge-file between 2 different version a file and a 
another file


  Hi,

  In my setup, I have sample files that I get from git pulling a regularly 
updated GitHub repository as well as "real files" (that are adapted from sample 
files to my environment but that are not tracked by the GitHub repo).

  Basically, when I do a "git pull" from GitHub repo, the sample files might 
change and if so, I want to apply these changes to my "real" files too.
  So what I thought is that I could do a "git merge-file" between the old 
sample file and new sample file and apply it to the old real file to get the 
new real file.

  Is it possible to call git merge-file on 2 different revisions of the same 
file (because in my setup, I would commit the changes on the sample files 
before doing this operation) and my old real file?

  I hope this makes sense...

  Cheers,
  Mathieu

-- 
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 git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to