On Thu, Apr 25, 2019 at 2:06 PM Igal Sapir <isa...@apache.org> wrote:

> On 4/25/2019 10:56 AM, Coty Sutherland wrote:
> > On Thu, Apr 25, 2019 at 1:32 PM Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA256
> >>
> >> Igal,
> >>
> >> On 4/23/19 12:52, Igal Sapir wrote:
> >>> Another thing that I have changed in my workflow based on Mark's
> >>> past suggestion, is that I keep a local repo for each major branch
> >>> now.
> >> Okay, I have done the following:
> >>
> >> 1. Fork tomcat master to my own GitHub account
> >> 2. git clone URL
> >> 3. edit/add/commit/push
> >> 4. Create a PR
> >>
> >> I'm sure I can import the PR into tomcat-master. No problem.
> >>
> >> Now, when attempting to keep my fork current, I've always done
> >> something like:
> >>
> >> git remote add upstream master-url
> >> git checkout master
> >> git fetch upstream
> >>
> >> And I'm all up-to-date.
> >>
> >> When I did that, I ended up bringing-down the 7.0.x and 8.5.x branches
> >> as well. How can I limit the upstream to just the master?
> >>
> > You can set the branch for your remote to master (or do it when you
> clone)
> > which should ignore other branches:
> > git remote set-branches upstream master
> >
> > Then optionally configure --no-tags in your git config (or use --no-tags
> > each time you git-fetch):
> > git config --add remote.upstream.tagOpt --no-tags
> >
> > Then try fetching to verify it worked:
> > git fetch upstream [--dry-run]
> >
> >
> >> Or does my fork have to have everything, but I have to checkout a
> >> single branch? If so, I'm not sure how to do that.
> >>
> > It doesn't, but by default a `git fetch` pulls down all new work that
> > exists on the remote, but not your local clone.
>
> I am sure that Coty knows git better than I do, so if he says that it
> doesn't then I stand corrected.
>

I don't know about that :) If you do a regular `git clone apache/tomcat` it
will pull the master branch and then references/histories for all remote
branches which for tomcat is about a 100M .git directory. If you clone a
single branch with no references such as `git clone apache/tomcat -b master
--single-branch` then you get just the references/history for the master
branch which results in about a 70M .git directory.

Note: the sytnax above is because I alias hub (https://hub.github.com/) to
`git` :) Check it out if you'd like to stop visiting the GitHub web UI for
opening PRs, etc.


> Igal
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>

Reply via email to