From: Chris Stankevitz 
  To: git-users@googlegroups.com 
  Sent: Tuesday, September 25, 2012 7:31 PM
  Subject: [git-users] Forcing a "push" from one branch to another


  Hello,


  If possible please humor me and attempt to answer this question:


  How do I make "b" look exactly like "a" using one commit?  Here is the manual 
approach:
Do you mean you want Branch 'b' drop its old line of development and become the 
same as Branch 'a'.
Or you want Branch 'b' to gain a fresh commit who's content is identical to 
that on the tip of Branch 'a', but it would have a different history?

In both case the top commit of b is the same, but the two variants would have 
different history.

There are a few different methods, and which one to use depends on what level 
of sophistication or plumbing commands you want.
At the plumbing level you can simply create a commit on 'b' that simply uses 
the top tree from 'a', then do a `reset --hard` to make your worktree match 
that commit. 


  - git checkout a.  Recursively copy all files in to /tmp
  - git checkout b
  - recursively copy all files from /tmp into cwd
  - git add [as appropriate]
  - git rm any files from cwd that are not in /tmp
  - git commit -am "Made b look just like a"



  Thank you,


  Chris

  -- 
  You received this message because you are subscribed to the Google Groups 
"Git for human beings" group.
  To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/z72DnZzvWyMJ.
  To post to this group, send email to git-users@googlegroups.com.
  To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
  For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

  No virus found in this message.
  Checked by AVG - www.avg.com
  Version: 2012.0.2221 / Virus Database: 2441/5290 - Release Date: 09/24/12

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

Reply via email to