...
Info | ||
---|---|---|
| ||
This article assumes using Eclipse Neon.1 which has built in Gradle and Git support. https://eclipse.org/downloads/ |
Table of Contents |
---|
Keep Plugins Up To Date
Info | ||
---|---|---|
| ||
We DO NOT USE the Marketplace for plugins anymore. Please reinstall your plugins from the update sites here: Installing plugins in Eclipse |
You want to make sure to keep Buildship and EGit up to date, including Gitflow support.
Uninstall Old Plugins
Configuration
Ensure autocrlf=false.
DO NOT SET 'core.eol'!
...
Make sure you are refreshing using native hooks, polling, and on access. Ensure UTF-8 encoding and Unix line endings.
Setting Default Pull Method to 'git pull --rebase'
ECLIPSE
...
Synchronizing
A fully up to date workspace with no incoming or local changes looks like this:
...
View | Description |
---|---|
Synchronize | Views the diffs between two branches, in most cases, your local develop and remote develop. You have the option to include also your uncommitted changes. |
Git Staging | Where you make commits. Add unstaged changes to index (staged), enter a commit message and commit. Careful, commit and push will send your commit to the remote! |
Git Repositories | Shows all the repositories you have cloned locally. Use this window to push and pull from individual repos, create branches, and other advanced Git operations. |
History | Shows a history of all the commits that changed the selected file. |
Rebase Interactive | Helps you step through commits as you rebase them onto the remote branch. |
Setting Up Synchronize
Set all Destinations.
Don't forget to check 'Include local uncommitted changes in comparison'.
...
Here is a reference for what the little icons mean.
Setting up History
Make sure to check 'Show All Branches and Tags':
Making a Commit
We make a change to FileTools.java:
...
Click commit.
Our commit is now ready:
Quick Commit
To perform a quicker style commit, right click and select Commit on a changed file.
...
Add and commit message a check or un-check the files you want the commit to contain. You also have the option to commit and push in one click.
Doing a Push
There are two ways to push:
...
DO NOT USE THIS PUSH BUTTON. It is very dangerous and could push more than you want.
Undo/Reset/Overwrite a Change
Doing a Fast-Forward Fetch and Rebase
Rebase on origin/develop:
Doing a Fast-Forward Pull
Pull from all repositories.
Doing a Pull With Rebase
First, you need to set Pull to 'Rebase' mode.
...
Resolve the conflicts in your file and mark them as Merged.
Continue rebase.
Doing a Reset
Say you make some changes that you want to reset before you have pushed them.
...
Two things are important. Reset to origin/develop and select Mixed to not overwrite your working tree. Select Hard to overwrite all local changes.
Result:
Stashing Changes
If you need to pull but you have conflicts, stash your changes, pull, then apply stashed changes. This is essentially a simplified rebase.
Advanced Operations
Doing a Squash
Find the commit below any commits you would like to squash in your local repository's history:
...
Rewrite your commit message:
Click okay:
Bugs and Workarounds
Items get stuck in Synchronize View
Sometime conflicting additions or conflicting moves that don't actual exist. will get stuck in the Synchronize View. The only way the flush them is to delete the Synchronization and make a new one.
Imported Gradle Projects Aren't Detected As Git Projects
In Git Repositories view, import local repositories cloned by Hephaestus.
...