Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362206 - EGit has issues with doing pull without merge strategy and has no way to easily set it
Summary: EGit has issues with doing pull without merge strategy and has no way to easi...
Status: CLOSED DUPLICATE of bug 382190
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-27 10:57 EDT by someone CLA
Modified: 2013-05-03 12:39 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description someone CLA 2011-10-27 10:57:46 EDT
Build Identifier: 20110916-0149

This is a problem when you're creating a new local branch or repo and then push it to the remote repo, you won't be able to do a pull on it without deleting it and recreating it from the new remote branch or manually editing the git configuration due to a missing merge strategy config entry.

The error box for pull should offer to automatically create such a strategy using a remote branch of the same name from the default remote repo.
And better yet is to offer to create this strategy entry immediatly after doing a push for a new branch. (the -u option to git push)

Reproducible: Always

Steps to Reproduce:
1. Try to use pull for a new local branch that you just pushed.
Comment 1 someone CLA 2011-10-27 11:36:58 EDT
Also adding force to the create dialog so you don't have to delete first would be nice.
Comment 2 Daniele Segato CLA 2012-04-16 10:22:52 EDT
I add this information, the error is this:

The current branch is not configured for pull
No value for key branch.bug/001150/some-bug found in configuration"

supposing "bug/001150/some-bug" is the name of the new branch

On git command line you are supposed to follow this workflow:

# create new branch
git co -b my-new-branch

#hack hack hack

# push at some time, requiring to set the new branch as tracking a remote branch:
git push --set-upstream origin my-new-branch

# next time you pull git know from where:
git pull


when you do --set-upstream (or -u for short) git add a section like this on the .git/config file of your project:

[branch "bug/001150/some-bug"]
        remote = origin
        merge = refs/heads/bug/001150/some-bug


I found no way with Egit to make it create that same configuration without manually adding the properties.

Suggestion: add a flag in the push dialog to set as upstream (selected by default, which is usually what you want to do)
Comment 3 Kevin Sheedy CLA 2012-10-02 12:35:07 EDT
Agreed. The upstream should automatically be set when the user does a Push.

Consider the following user story which is easy using TortoiseGit but just took me hours to figure out using eGit:

1) I create a branch and make some commits
2) I Push this branch and commits to a central repo
3) My colleague Pulls from the central repo and sees my new branch
4) My colleague switches to this new branch (which is also a bit tricky due to bug 341679)
5) They make some commits and then Push them back to the central repo
6) I pull from the central repo and see my colleague's changes


This is one of the most common workflows and should be really easy. Instead, it is very tricky and requires a relatively deep understanding of git's tracking branches etc. Most newbies take a long time to get comfortable with that stuff.
Comment 4 Robin Stocker CLA 2012-10-02 17:33:15 EDT
Please see bug 382190 about my plan to improve the "publish branch" workflow.

And bug 341679 is also on my list. It's probably one of the most confusing things for newcomers.
Comment 5 Robin Stocker CLA 2013-05-03 12:39:26 EDT
Marking this as a duplicate of bug 382190.

Please also note that the upstream configuration can be set via the Git Repositories view -> right click on branch -> Configure Branch...

*** This bug has been marked as a duplicate of bug 382190 ***