Michael K
Michael K

Reputation: 3345

Shortening Eclipse git workflow

I use a rebase workflow with Egit in Eclipse. I work on a local branch, call it "working" for the purposes of this question. When I'm ready to integrate my changes, I have to:

  1. Switch to master
  2. Pull (fast-forward)
  3. Switch to working
  4. Rebase master, resolving any conflicts
  5. Switch to master
  6. Merge working
  7. Push.

As you can see, there is a lot of branch switching going on. It's not a big time drain, since switching branches is pretty fast. However the time adds up and it's additional steps to teach new people to do. What I'd really like to do is, while on working:

  1. Pull (resulting in master being updated)
  2. Rebase master
  3. Switch to master
  4. Merge working
  5. Push

In this workflow, I also wouldn't have to completely unnecessarily switch branches just to pull in changes and continue working. Just pull, rebase, continue.

How do you configure git to always update master on a pull, even if you're on another branch? I'd prefer an answer that uses Egit, but command line solutions are acceptable too - they may be able to be performed with Egit.

Upvotes: 2

Views: 93

Answers (1)

VonC
VonC

Reputation: 1325077

You could rather:

  • fetch (no need to change your current branch working)
  • rebase origin/master working
  • switch to master and merge working (fast-forward)

The last step would update master with both origin/master and working.

Upvotes: 2

Related Questions