From owner-freebsd-x11@freebsd.org Wed Apr 5 16:19:49 2017 Return-Path: Delivered-To: freebsd-x11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9FA1D3059C for ; Wed, 5 Apr 2017 16:19:49 +0000 (UTC) (envelope-from dbkirk@gmail.com) Received: from mail-pg0-x234.google.com (mail-pg0-x234.google.com [IPv6:2607:f8b0:400e:c05::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B9F3A98 for ; Wed, 5 Apr 2017 16:19:49 +0000 (UTC) (envelope-from dbkirk@gmail.com) Received: by mail-pg0-x234.google.com with SMTP id x125so10429334pgb.0 for ; Wed, 05 Apr 2017 09:19:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tntwsH2IR4FHzNw/BCT1mVzk1UQiW9MoWP2UVHS9wr8=; b=lXrXXYWY9E8yugdJsitWGvLRfyyOGYVFN2+6PzW730j40rQ3eby8w9AWkAfNPBkdp/ 4c5HbwHAWNzhdS8GBPUWNivN53jxPCkXWXrsEF5B9YaOzL6Va6E5aNT1QUKd/GxSm1C2 V9KF8sRl9SQpe+FO5y+kahwkNB3XQphuX4brQKa9FWoLd7l5jTrwjCtREGkfjAe3QOqb n0ot3ZSU+NFDJi9ciCfsy8kAbJZdfei8P/1VElH5qaLN0Voq2DvLAWgKh61vNIsDio7V 0/CGMPqo+Xpdd4hCEV0fSArACrTh4uZ8nOhFoZETS/FlvO/pm/aMI1ftwoUVXQ79gKfA ejnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tntwsH2IR4FHzNw/BCT1mVzk1UQiW9MoWP2UVHS9wr8=; b=iCrWh5dxIDoUw/dYgY9ZsOAWIGO65j6JU3xexI15cbA+/vMhl795+N0d0AFVujmgVC +jL5bkjYiL1Rl+lT2TlLQVasDf5j940wXTZ+foNshUFXppdvQ9IeqYS4+YmXeVx4g0ZN keQ7Dbi38D77zabAazFA1BZ+/FvVMuIBfuChJdCsrI8VTIZ/RiPJ69BKpuChPfaDhjsa tpLhsjnG/jhmIUJaKD3m70+xR+UfK8rU+5j5z8sqcZRKbreU8FWMb2zpeiXBDhdbiFds Xmje6ZcRD0LTmTNQSREKHKkHv4iBeEzMW6KdC3I3TWyi3xF7t1edVSh3IiSswSl7luoR yYcA== X-Gm-Message-State: AFeK/H1wXVF40AOjRQ9j8rrnkPQF98aAujoRhDnmWwIjTVxCE0tKNowDcan5WHfrX0Pg7LladwVc70LIgf+PXA== X-Received: by 10.98.156.23 with SMTP id f23mr29879943pfe.3.1491409189027; Wed, 05 Apr 2017 09:19:49 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Doug Kirk Date: Wed, 05 Apr 2017 16:19:38 +0000 Message-ID: Subject: Re: Switching branches of freebsd-base-graphics with git To: Andreas Nilsson , Thomas Mueller Cc: FreeBSD X11 mailing list Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Apr 2017 16:19:49 -0000 `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 wrote: > On Wed, Apr 5, 2017 at 9:33 AM, Thomas Mueller > 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" >