From: Seth Robertson <in-gitvger@baka.org>
To: manoj soni <manoj6891@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git and github query about maintaining project
Date: Tue, 03 Jan 2012 15:21:37 -0500 [thread overview]
Message-ID: <201201032021.q03KLblT024296@no.baka.org> (raw)
In-Reply-To: <CA+KSefW+K1hMiFkrFCP1LAVjfV9hECwFWAHz940fwGJawHuoFQ@mail.gmail.com>
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
prev parent reply other threads:[~2012-01-03 20:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[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 message]
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=201201032021.q03KLblT024296@no.baka.org \
--to=in-gitvger@baka.org \
--cc=git@vger.kernel.org \
--cc=manoj6891@gmail.com \
/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