Re: git and github query about maintaining project

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

 



In message <CA+KSefW+K1hMiFkrFCP1LAVjfV9hECwFWAHz940fwGJawHuoFQ@xxxxxxxxxxxxxx>, 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]