git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hilco Wijbenga <hilco.wijbenga@gmail.com>
To: lancelyons <llyons2@cox.net>
Cc: git@vger.kernel.org, Michael Witten <mfwitten@gmail.com>
Subject: Re: Git rebase basics
Date: Wed, 13 Jun 2012 21:39:03 -0700	[thread overview]
Message-ID: <CAE1pOi3uXHcXm=fpH-e6pHyBTAACS7=KkdR9jQEuEjzoXy1w=A@mail.gmail.com> (raw)
In-Reply-To: <1339642794317-7561489.post@n2.nabble.com>

On 13 June 2012 19:59, lancelyons <llyons2@cox.net> wrote:
> Sorry about that.. I thought I was being pretty descriptive but maybe I
> missed something.

Perhaps "descriptive" but certainly not "precise".

> After we setup Git (msysgit) and set it up using Apache with active
> directory authentication, I added a repository using git init --bare then I
> copied my files I wanted to add to the repository and did a git add . and
> git commit -a
>
> So that all worked.   We have done several clones using git clone with this
> remote repo.  We have also done  git push and git pull to verify everything
> is working ok.   Everything was working fine.
>
> So back to my original train of though.
>
> I am trying to learn more about rebase so i have cloned the central repo two
> times  (I call the central repo the origin) doing the following (to help you
> understand)
>
> git clone https://servername:port/repopath c:\clonedrepo1
>
> git clone https://servername:port/repopath c:\clonedrepo2
>
> and then made changes to this cloned copy (clonedrepo1) and pushed two
> commits back to origin.
> (git commit -a  two times)
>
> so now I have the following in the remote repo (origin)
>
> origin -->  C1 --> C2
>
> (Note to help you understand  C1 = commit 1 and c2 = commit 2, etc)
>
> In the other cloned copy (clonedrepo2), which I consider a branch, I have
> made two more commits  C3 and C4
>
> clonedrepo2 --> C3 -->  C4
>
> I am able to easily pull from origin to get my clonedrepo2 to look like
> clonerepo2 --> C3 --> C4 --> C1 --> C2 using git pull origin  or git pull
> https://servername:port/repopath
>
> however I was wanting to rebase the clonedrepo2 branch so that it shows
> clonerepo2 -> C1 --> C2 --> C3 --> C4
>
> In other words I am wanting to rebase clonedrepo2 to the master of the
> origin.

What you want is "git pull --rebase origin master". See "git help
pull". Also check "git help fetch" if you really want to keep doing
this.

But it sounds like you should simply be using a real branch. You can
do "git pull" on your master branch and then run "git rebase master"
on your own branch. Did you really read up on Git? It has truly
excellent documentation. See for example http://git-scm.com/book (but
this is just one of many).

> I thought the command to do this was   git rebase origin master but that
> doesnt work and I get
>
> C:\clonedrepo2>git rebase origin master
> Switched to branch 'master'
> Your branch is ahead of 'origin/master' by 2 commits.
> Current branch master is up to date.
>
> I know my my branch is ahead by c3 and c4 but it does not have C1 and C2
>
> Thoughts.
>
> --
> View this message in context: http://git.661346.n2.nabble.com/Git-rebase-basics-tp7561468p7561489.html
> Sent from the git mailing list archive at Nabble.com.
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2012-06-14  4:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-13 20:59 Git rebase basics lancelyons
2012-06-14  0:07 ` Michael Witten
2012-06-14  2:59 ` lancelyons
2012-06-14  4:39   ` Hilco Wijbenga [this message]
2012-06-14 16:01     ` lancelyons
2012-06-14 16:28       ` Michael Witten
2012-06-14 17:21         ` lancelyons
2012-06-14  5:00   ` Michael Witten

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='CAE1pOi3uXHcXm=fpH-e6pHyBTAACS7=KkdR9jQEuEjzoXy1w=A@mail.gmail.com' \
    --to=hilco.wijbenga@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=llyons2@cox.net \
    --cc=mfwitten@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;
as well as URLs for NNTP newsgroup(s).