Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » RefSpec question Git vs. Egit(RefSpec question Git vs. Egit)
RefSpec question Git vs. Egit [message #1001503] Wed, 16 January 2013 20:50 Go to next message
Steve Coffman is currently offline Steve CoffmanFriend
Messages: 1
Registered: January 2013
Junior Member
I'm used to git at the command line, and I'm trying to translate my workflow into Egit.

However, there appear to be some major differences that are confusing me.

The biggest appears to be differences in Fetch and Push refspecs.

In Git, when I track a remote branch branch, I can push and pull directly:

  • git checkout --track -b refactored origin/refactored
  • make changes
  • git commit -am "Made some changes"
  • git push origin refactored

After this, my .git/config files are set to:
[branch "refactored"]
	remote = origin
	merge = refs/heads/DEV
	rebase = true


In EGit, in order to push and pull, after I clone and select the "refactored" branch I need to:

  • Right Click on project name, select Team -> Remote -> Configure Fetch
  • Ref mappings should be "+refs/heads/*:refs/remotes/origin/*" (no quotes) and then Save

  • Right Click on project name, select Team -> Remote -> Configure Pull
  • Ref mappings should be "+refs/heads/*:refs/remotes/origin/*" (no quotes) and then save


My EGit .git/config usually ends up looking like this:
[branch "refactored"]
	remote = origin
	merge = refs/remotes/origin/refactored


This seems like maybe I'm doing things wrong. Any ideas? Thanks for any illumination.
-Steve
Re: RefSpec question Git vs. Egit [message #1002398 is a reply to message #1001503] Fri, 18 January 2013 14:03 Go to previous message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
When you say 'select the "refactored" branch", what do you mean exactly?

What you want to do here is:

- Open the "Branches" dialog [several of ways to get here, I usually use the toolbar item]
- In that dialog open the "Remote Tracking" section and select the remote branch you want to track
- Click the "New Branch..." button, which will show the "Create Branch" dialog
- Choose the 'rebase' radio button option as 'pull strategy' [if you want rebase; the default is merge]
- Ensure that the the "Checkout new branch" checkbox is checked, which it is by default.

It's much quicker and easier than it sounds.



Previous Topic:How to on EGit
Next Topic:Equivalent of `git add -A` and `git show` in jGit
Goto Forum:
  


Current Time: Tue Mar 19 09:25:32 GMT 2024

Powered by FUDForum. Page generated in 0.01626 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top