unarist
unarist

Reputation: 616

Merge upstream without specifying branch name

I'm using Git with many feature branches.

When I want to update master and featureX

# Update master
git checkout master
git pull

# Update featureX
git checkout featureX
git pull

It works and simply. But it takes a while because I run git pull including fetch twice.

In another way...

# Update featureX
git checkout featureX
git merge origin/featureX

OK, I fetched only once. But I have to specify origin/featureX even the branch is upstream.

Is there an alias for upstream, or easy way to update branch without fetching?

Upvotes: 1

Views: 47

Answers (1)

Vaibhav Sagar
Vaibhav Sagar

Reputation: 2266

From this answer, an alias for upstream is

git rev-parse --symbolic-full-name --abbrev-ref @{u}

Upvotes: 2

Related Questions