"git pull --rebase" in Eclipse - eclipse

Our version control manager recommends us to use git pull --rebase to pull new changes from upstream branch. I want to use EGit (Eclipse plugin for git) to execute that. How can I do this?

You can also change the rebase configuration of a branch from within Eclipse:
Open the Git Repositories view and navigate to the local branch
Open the context menu and select Configure Branch...
In the resulting dialog, select the Rebase checkbox
EGit also honors the "branch.autosetuprebase" configuration when a new branch is created.

Use
git config branch.*branch-name*.rebase true
And pull will automatically rebase.
You can set it up to configure new branches automatically.
git config branch.autosetuprebase always

New update in Eclipse Mars shows the 'Pull...' option to rebase:

Related

pull from non local git repository using Egit

I am trying to do a "pull" from my git repository on bitbucket, using Egit (Eclipse). I can do "push" without any problems, but when I try to pull I get the error message:
The current branch is not configured for pull No value for key
branch.master.merge found in configuration
I have tried creating new branches from both eclipse and bitbucket, but the can't seem to "communicate". When I create a new branch in eclipse, it's automatically a local ( which it shouldn't be)
How can I set up my eclipse and bitbucket for "pulls" (not local)?
(I am a bit confused as I thought I was connected to the repository, since push works)
Any help will be greatly appreciated
You need to specify an upstream branch.
The push works because of the default push policy "simple".
With Egit:
Access "Configure Branch":
Go to "Git Repositories" view,
Expand the branches, local
Then:
Right-click your checked-out local branch that can't pull
Select "Configure Branch...":
For "Upstream Branch:", put "refs/heads/yourBranch"
For "Remote:", put "origin"
Leave "Rebase" unchecked
Hit OK

How do you get files updated from a GIT repository in eclipse?

I have successfully checked out a project from GIT hub but since then changes have been made to the repository. When I right click to team the PULL option is grayed out, when I fetch from upstream it says the files are up to date, but that is not true. I can verify this by visually comparing the file on my computer to the file at GIT hub. Is there any way to resolve this problem other than switching back to subversion?
You need to merge the fetch upstream into your branch to get the updated repository.
Or, you can use terminal
git pull origin master
Check this git pull docs
Also, Pull option is graved out because egit requires the branches to be set up for pull for the option to be available.

EGit: Merge without a commit

Is it possible to merge a branch without a commit like it would be possible with C git git merge myBranch --no-ff --no-commit?
Repository settings like merge.ff = no or merge.commit = no are ignored.
I'm using EGit 3.0 which comes with the new Kepler release of Eclipse.
The merge options are available in the merge dialog which can be invoked like this:
Select a project
Open its context menu, select Team > Merge...
Chose the branch to merge and the desired options below
Note that currently only squashing and fast-forward options are supported.
It's now available in EGit 3.1 and later.
Indeed it is! You have to use git rebase. This blog post explains how to do it: http://www.kerrybuckley.org/2008/06/18/avoiding-merge-commits-in-git/

How do I get my new eclipse branch to show up as a new project in my github repository?

I am working through a programming book and I want to branch off of master for each chapter, then merge back to master once the chapter is completed, but have the chapter specific branch show up in my github permanently. What is the best way to do this through the eclipse gui? I have already created the branch in eclipse, but I can't get it to create the duplicate project branch in github.
Github repository
-master
-chapter1
-chapter2
If your "Team => Push to Upstream" is grayed, you need to specify the upstream address of your local Git repo in your Eclipse Egit configuration: see "Eclipse/Egit, Push to Remote menu choice is grayed out".
Check also your SSH2 config in the same EGit.
Finally, click on "Add all branches spec" in order to push all your local branches to the upstream repo:
Did you push the branch?
git push origin chapter1
git push origin chapter2
...etc...
(Note: If you're using a graphical interface for git in eclipse you might consider adding that information to the question.)

How to create default branch with Eclipse?

When I am creating a repository in Git it says "This repository's default branch is empty!"
Earlier I had a master branch and a source button with SSH, HTTP.
So how can I create this default branch, without using the terminal?
When you create a new, empty, git repository you will have an empty default branch until your first commit.
When using EGit, you can create a new git repository from the Git Repositories view. See Creating a Repository. When that's done, I create my workspace projects, uncheck "default location", and specify a directory within my newly created Git repo. There's more of a discussion on creating git repos in relation to a workspace in Considerations for Git Repos.
Thx all but i resolved my issue.
In repository Admin panel just need to check GitHub Pages, it creates "gh-pages" branch and shows a source button with SSH, HTTP.