Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 05 Apr 2017 16:19:38 +0000
From:      Doug Kirk <dbkirk@gmail.com>
To:        Andreas Nilsson <andrnils@gmail.com>, Thomas Mueller <mueller6722@twc.com>
Cc:        FreeBSD X11 mailing list <freebsd-x11@freebsd.org>
Subject:   Re: Switching branches of freebsd-base-graphics with git
Message-ID:  <CAGhTqAW7aRiFtiM9XrcXVehdoxEMkckLCu651XM9oP7OTRZ1BA@mail.gmail.com>
In-Reply-To: <CAPS9%2BSvcSdcALYgRyhdw2oqE93cPUb94pzYsP=BDQQadLXfzmg@mail.gmail.com>
References:  <E7.99.29375.6FD94E85@dnvrco-omsmta02> <CAPS9%2BSvcSdcALYgRyhdw2oqE93cPUb94pzYsP=BDQQadLXfzmg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
`git pull` is just sugar for `git fetch` (fetch remote updates) then `git
merge` (merge them into the current work tree).

Since git pulls down the entire repo (unlike svn), `git checkout $branch`
is enough (AS LONG AS you originally cloned the entire repo instead of just
one branch -- `-b $branch` on the clone command).

So after the checkout as above, `git pull` should be enough to get the
currently checked-out branch's updates from the remote repo.

Even if you didn't clone the entire repo, `git checkout $branch` followed
by `git pull` is enough to checkout the branch and get its updates.

You can get a (local & remote) branch list with `git branch -a`. It'll show
a star for the current branch.

Also keep in mind that git won't do anything with non-tracked files, so
you'll likely want to `make clean` to get rid of prior-branch remnants.

Cheers!

On Wed, Apr 5, 2017 at 4:06 AM Andreas Nilsson <andrnils@gmail.com> wrote:

> On Wed, Apr 5, 2017 at 9:33 AM, Thomas Mueller <mueller6722@twc.com>
> wrote:
>
> > I tried to switch freebsd-base-graphics tree from drm-3.8 (something like
> > that, now outdated to drm-next and made a mess.
> >
> > First, from /freebsd-base-graphics, I did
> > git checkout drm-next
> > but then git pull didn't work, I got message about not having repository.
> >
> > "git checkout drm-next"  switched branches but didn't download anything,
> > hence my try with "git pull".
> >
> > After some struggle, I did
> > git clone https://github.com/FreeBSDDesktop/freebsd-base-graphics.git -b
> > drm-next
> >
> > from /freebsd-base-graphics directory, but that resuted in the tree being
> > downloaded to /freebsd-base-graphics/freebsd-base-graphics
> >
> > I recovered by renaming (mv) /freebsd-base-graphics to
> > /freebsd-base-graphics-old, then moved
> /freebsd-base-graphics-old/freebsd-base-graphics
> > to /
> > and then, with the new stuff separated from the old,
> > rm -R /freebsd-base-graphics-old
> >
> > That seemed to work, inelegantly.
> >
> > Question is how to switch the branch and download the new branch over the
> > old, like "svn sw", but with git.
> >
> > I looked through the documentation, even went to git-scm.org, even a PDF
> > book "Jump-Start Git" but still couldn't see what I should have done.
> >
> > There has to be a simpler way, but I couldn't find it in the
> documentation
> > of git.
> >
> > Tom
> >
> > _______________________________________________
> > freebsd-x11@freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/freebsd-x11
> > To unsubscribe, send any mail to "freebsd-x11-unsubscribe@freebsd.org"
> >
>
>
> Hello!
>
> I've switched branches a few time to keep track of progress and going from
> 11-STABLE to 12-CURRENT. I did
>
> git fetch ( this fetch info on new branches and code and so on )
> git checkout $branch
> git pull
>
>
> Subsequent upgrades are done with
>
> git fetch
> git pull
>
> I'm by no means a git expert, so please correct me if I'm wrong.
>
> Best reagards
> Andreas
> _______________________________________________
> freebsd-x11@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-x11
> To unsubscribe, send any mail to "freebsd-x11-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGhTqAW7aRiFtiM9XrcXVehdoxEMkckLCu651XM9oP7OTRZ1BA>