git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git and github query about maintaining project

From
SRSeth Robertson <in-gitvger@baka.org>
Date
Jan 3, 2012, 20:21 UTC
Message-ID
<201201032021.q03KLblT024296@no.baka.org>
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
Previous: manoj soni
Message 2 of 2 in “Fwd: git and github query about maintaining project”
  1. manoj soniJan 3, 2012
  2. Seth RobertsonJan 3, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.