* Fwd: git and github query about maintaining project [not found] <CA+KSefVajgEBCH+31a0DLXPGUgb2yshxPeXV+SdmGvPFVBOBtg@mail.gmail.com> @ 2012-01-03 19:42 ` manoj soni 2012-01-03 20:21 ` Seth Robertson 0 siblings, 1 reply; 2+ messages in thread From: manoj soni @ 2012-01-03 19:42 UTC (permalink / raw) To: git Dear Admin, Forwarding you below email, which I have sent to wrong email address by mistake. Thanks, Manoj ---------- Forwarded message ---------- From: manoj soni <manoj6891@gmail.com> Date: Tue, Jan 3, 2012 at 2:20 PM Subject: git and github query about maintaining project To: git@vger.kernel.orgm, support@github.com Dear Admin, I am using git along with github since august 2011. I am new to it but now I know it significantly. It is interesting and helpful. I have started with a already existing project (say P). We were two persons working on this project, so we forked P (on github). I got project forked copy C1 and my friend got C2. We each have committed to C1 and C2 independently. Now my friend merged his commits from C2 to P and moved out of this project. I have created a branch OLD in my repository C1 along with a already existing master branch. What I want to do that in my project C1, OLD branch should have all of my commits and master branch should be same as P. Please tell how should I do this? I am trying since a week to get it done, I have attempted some unsuccessful tries, which I can tell you if you want. If you need more information, please tell me. Hope to get response. I shall be thankful. Manoj Soni ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: git and github query about maintaining project 2012-01-03 19:42 ` Fwd: git and github query about maintaining project manoj soni @ 2012-01-03 20:21 ` Seth Robertson 0 siblings, 0 replies; 2+ messages in thread From: Seth Robertson @ 2012-01-03 20:21 UTC (permalink / raw) To: manoj soni; +Cc: git In message <CA+KSefW+K1hMiFkrFCP1LAVjfV9hECwFWAHz940fwGJawHuoFQ@mail.gmail.com>, manoj soni writes: Forwarding you below email, which I have sent to wrong email address by mistake. You might want to ask on the IRC #git channel for tactical support questions, like this. irc://irc.freenode.net/git we forked P (on github), I got project forked copy C1 What I want to do that in my project C1, OLD branch should have all of my commits and master branch should be same as P. Tactically, the answer to your question is as follows: ---------------------------------------------------------------------- # Create a new branch OLD from where master is (presumably containing your commits) git checkout -b OLD master # Share OLD with your forked C1 (if you want to) git push origin OLD git branch --set-upstream OLD origin/OLD # Get access to the repository you forked from git remote add P URL-TO-P git fetch P # Reset the master branch to the contents of P/master # Please note that any uncommitted changes WILL BE LOST git checkout master git reset --hard P/master # Share your rewritten history with origin (C1) # Please note, rewriting publicly visible history is a BAD IDEA. # Anyone else who might have pulled the old history will have to do # special things and may hate you forever. git push -f origin ---------------------------------------------------------------------- However, interpreting what you are really trying to do (get your changes and C2's changes put together and uploaded to P), this is what *I* would do: ---------------------------------------------------------------------- # Get access to the repository you forked from git remote add P URL-TO-P git fetch P # Merge your development with the other development that has been happening git merge origin/P # Share your rewritten history with origin (C1) git push # When you have finished testing (unless you are using the github pull request method) git push P master ---------------------------------------------------------------------- -Seth Robertson ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-01-03 20:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CA+KSefVajgEBCH+31a0DLXPGUgb2yshxPeXV+SdmGvPFVBOBtg@mail.gmail.com>
2012-01-03 19:42 ` Fwd: git and github query about maintaining project manoj soni
2012-01-03 20:21 ` Seth Robertson
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox