From owner-freebsd-x11@freebsd.org Thu Apr 6 01:08:51 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 693A0D319AC for ; Thu, 6 Apr 2017 01:08:51 +0000 (UTC) (envelope-from dbkirk@gmail.com) Received: from mail-pg0-x232.google.com (mail-pg0-x232.google.com [IPv6:2607:f8b0:400e:c05::232]) (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 3A502B05 for ; Thu, 6 Apr 2017 01:08:51 +0000 (UTC) (envelope-from dbkirk@gmail.com) Received: by mail-pg0-x232.google.com with SMTP id g2so19961101pge.3 for ; Wed, 05 Apr 2017 18:08:51 -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=E+2NzWblDx+dOTHqrytqN8qKUNuN4OuDO16D/b2v9r0=; b=TNrQiaUGs85/BGxe1haKHex7BIrK1FC62Vr0l9CNHOWeIeMvb5oPMcXQuKn2aa2lp+ vbKsH+O8S+oqjDN9YaCrcdCXOHVaTlRBss6gZAWeLKdGhEk/SYlyu2+zB6xR85CG3L8l 3Ewaufb09EEIUdsy3MuQsrPZFWuUSGORMBrgEPvxsROtDaK6WqtsXIfHs+pgOjogorYa ztTYkstD93ttOahKGXldNDkcKEt50rP6wCayMOs+alFC5YZ/sWae+72rYjJMwR+UpSA1 ftzQcwS9zxh7JFohDnoJBkP26Qpa1N7j0gf828BL1lTO1izU+Ok0cA6OVIOJU9RS/rcn B6Cw== 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=E+2NzWblDx+dOTHqrytqN8qKUNuN4OuDO16D/b2v9r0=; b=bYnz1Xww1bxDWS6X7jxWjRLnU9ziRVVRyGX7xd/PcDwXYN7WpfRHiGADpt4fQvYihI 82KXbYo4YU70+cJtzXti83Jz99pVFRNLVFe0AmZv9yMKqutKIPdkDsqz2VVu9e28vjYU dIMvFu6WJrGVBMdXat+B5KYncV2xyBOo4FShg9wReUzAEakDSf2C9meA9OsVYpfu+4Ie SBCjRUAEfHZybFxMdKnPDHCLVh22Ri86D+QP2JZb83NDE4jadLGyI7b6OrjJysPBlBYt /8X14D4PiUXVB1cUWFkGanRcrzxhLZvLeyMuIoVgcfpARcSQNY0Y224W2gwhMbtr58w1 AMJA== X-Gm-Message-State: AFeK/H2+A+joxM/rnxTsOcM6I3Q2FPTVmiGBkbcbS+k+urKSYKvtPpb82NoUa91MtJnGUzfG9FmWipA8AFQuTw== X-Received: by 10.99.109.137 with SMTP id i131mr33036119pgc.103.1491440930766; Wed, 05 Apr 2017 18:08:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Doug Kirk Date: Thu, 06 Apr 2017 01:08:39 +0000 Message-ID: Subject: Re: Switching branches of freebsd-base-graphics with git To: Thomas Mueller , freebsd-x11@freebsd.org 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: Thu, 06 Apr 2017 01:08:51 -0000 I wouldn't `rm -R *`, that seems dangerous. :O Try `git checkout drm-next` followed by `git pull origin drm-next`. The latter command needs internet access while the former doesn't. (Because of your fetch, one of those may complain...I can't remember. If so, `git reset --hard` will get you back to the last-committed state of the current branch, after which you can checkout and/or pull.) `git clone $url [$name]`: Copy the git *repository* at $url into a new subdirectory of the same base-name [or $name]. You see the working tree; the repo is in its .git/ subdirectory, including all branches and the entire version history. `git checkout $branch`: Make your working tree look like the committed state of $branch. Usually to switch branches. A branch in git is just a type of "ref", and you can check out any $ref. Other types are tags and revisions. `git pull`: `git fetch`, and then `git merge`, upstream changes into your current working tree, and then commit those changes to your local repository if there are no conflicts. (not technically 100% accurate, but the effect is the same). `git status`: Show the current checked-out branch and the state of working tree modifications. `git fetch`: Fetches new commits from a remote, but doesn't merge those into your working tree or commit them to your current branch. `git reset`: If you've made uncommitted changes that you want to undo, this will undo them. (see man page about --hard, --soft, and --mixed variants). All the git commands have man pages, accessible either by `git help {command}` or by `man git-{command}`. (e.g., either `man git-pull` or `git help pull`) Notes: I don't know what the "remote" repo names (in your command `git fetch remote`). With git-fetch (or pull), that is a repo name (which is just some string you assign as a name for a repo, whether it's local or remote). Usually we use "origin" there...which identifies the repo that yours was cloned from unless you've edited the configuration. A "remote" is "some other repository that's not the one in your current project's .git/ subdirectory". Meaning that, even though it's called a remote, it could just be another directory on the local filesystem (outside your project dir). In `git pull origin drm-next`, the remote name is "origin" as explained above, and "drm-next" is the *remote's* branch name to fetch/merge into *your current branch*. If you're not making changes, you really only need to know `git clone`, `git checkout`, followed by periodic `git pull` to get the latest changes. The `git reset` command has variants to reset the working tree and/or the "index". The index is just the place where git stores to-be-committed changes (usually a subset of the working tree changes). Good luck with your taxes! P.S., Per is correct, `git clone $url -b $branch` clones the entire repository but checks out the named branch. On Wed, Apr 5, 2017 at 6:23 PM Thomas Mueller wrote: > from Doug Kirk: > > > `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. > > I ran "git branch -a" on this computer and the other, showed branches, but > got more on this computer than the other: drm-next showed on this computer > but not the other. > > I ran "git fetch remote", thinking I would update the list of branches, > but got a bigger download. I am still in branch drm-i915-update-38 on that > computer. > > So I am lost at this stage, only way I can see is rm -R * from > /freebsd-base-graphics and start over with new branch. > > Now my head is spinning/swimming. I need to wait until after I finish my > income tax return. > > > Tom > >