Chris,

On 4/25/2019 10:32 AM, Christopher Schultz 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

Since you are a committer you don't need to this.  That is useful though if you want to show a large update so that others can review it, but you can also do that in a new branch.

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?

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.

Your fork has the whole git repository, but fortunately git manages resources much better than Subversion, for example, so it's not too bad at all.

You can see a list of the local branches and which branch you are currently on with the command, `git branch`, which will show something like this:

> git branch
  7.0.x
  8.5.x
* master

The `*` denotes the current branch, so I am on the master branch.  Switching to the 8.5.x branch with `git checkout 8.5.x`

> git checkout 8.5.x
Checking out files: 100% (1787/1787), done.
Switched to branch '8.5.x'
Your branch is up to date with 'origin/8.5.x'.

And then running again `git branch` will show the * next to 8.5.x:

> git branch
  7.0.x
* 8.5.x
  master

In some projects it's easy to maintain a single repository and switch between branches, but I find the differences between 7.0.x and master to be so major that I chose to follow Mark's method and keep separate local copies where the IDE settings do not get mangled up each time I switch branches.

I'm just *sure* I'm gonna love git once I get this all figured out.
All the cool kids seem to love it, so it must be better, right?

It is WAY better, and I'm not even cool (let alone a kid)!

Best,

Igal



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

Reply via email to