Posts Tagged ‘Git’

Mylyn Github Connector

Tuesday, May 10th, 2011

Just in case you missed it, there is a prototype for a Mylyn and Github connector available. Please see https://github.com/blog/852-github-mylyn-connector-for-eclipse for the official announcement.

Installing the connector is pretty straight forward you can directly install it from the Eclipse Marketplace client. The only pre-requisite is that you add the Orbit repository http://download.eclipse.org/tools/orbit/downloads/drops/S20110422041657/repository/ and install “Gson” from the com.google.* category (thanks to Christian Trutz for the tip on twitter).

Importing your issues is as easy as File -> Import -> Tasks -> Github Task Repositories and then you can define new queries for this repository.

The first test unfortunately failed. During a submit of a new issue with the error “Submit failed: Unexpected error: Unprocessable Entry”.

Still the connector looks very promissing. Git is my favorite version control system and I love Github. Its great that soon Mylyn will also to share issues and ther context via GitHub.

I suggest you give it a test run. If you find issues you can report them in bugzilla: Mylyn EGit Connector.

Update: The bug is already fixed, looks like testing will get your bugs solved fast. :-)

Git Alias – git add -A and git commit in one command

Saturday, December 25th, 2010

In in 95% of my time I type “git add . -A” directly followed by “git commit -m “message” in the Git version control system.

That is a lot of typing for a very common case. Fortunately git allows to add an alias for the command. To add an alias for git add and git commit to your git configuration, open your .git/config file and add the following.

[alias]
        ac = !git add -A && git commit

Alternative you can use the –global flag from the command line:

git config --global alias.ac '!git add -A && git commit'

You now can add and commit to your Git repository via the command:

git ac -m "message"

Unfortunately alias seems not to be supported on the window implementation of git (msysgit). See the bug report: msysgit does not support alias definition.

I hope this helps. More details can be found in my Git Tutorial. You may want to follow me on Twitter.

The unnecessary complexity of Git

Tuesday, September 21st, 2010

Git is one of the greatest distributed version control system and EGit will pave the road to success for Git in the Eclipse world.

But some things make the usage of Git difficult for new starters. I would like to highlight one particilar case; how to add files to the index. The approach differs based on the situation. New files, deleted files and already commited files are treated differently. In my opinion Git is missing one command to add all changes to the index including deleted, changed and new files. Even better git should have a commit command which add everything to the index and commits it. Experts may want finer control but in my opinion this missing option makes it hard for new starters.

Perhaps git will add such a feature in the future, in my humble opinion the power of a complex workflow should not be payed with the lack of simplicity.

The following command will add everything to the index except deleted files.

git add .

Unfortunately IMHO there is not “git add .” for removed files. You can not tell git to add all files which are deleted to the index via wildcards. The following will not work, you need to specify the files individually.

git rm .

The starter may think I just use git commit -a to do all this adding and deleting. Unfortunately this will only add deleted files and files which are already commited to the index. New files are not included.

git commit -a -m "message"

If you want always to add your deleted files and as well as stage files what are already commited you should use the following command. This will not add new files to the index. Thanks to Heath Borders for the clarification on this command.

git add -u .

I hope this helps, at least I got stuck for a while in these suble but important differences. Handling this example and much more can be found in my Git Tutorial.

Btw. please don’t get me wrong I like having all these options but in addition to these option I believe git would be easier if it had one “add-it-all” option.

You find me also on Twitter .

The JUG which lives – EGit presentation on 02.Sept. at the Majug

Monday, August 30th, 2010

Since beginning of last year I participate more or less actively in the Java User Group Mannheim. Unfortunately the former main contact of the Java User Group Mannheim Alex Hanschke has moved out of the area.

Benjamin Muskalla and myself volunteered to help organize the JUG Events. Therefore Benny and I will as of now try to find great new speakers and setup cool events. I think we are starting very well, as we are proud to have Matthias Sohn and Stefan Lay speak about Git and EGit on the 02.Sept. Git is one of the leading distributed version control systems and EGit a team provider for Eclipse.

Matthias and and Stefan are both committers in the EGit project. Details on Matthias and Stefan and the presentation can be found on the Majug Event Announcement. As usual we organize to have drinks after the event and hope Matthias and Stefan will be able to join so that you can bugger them with questions. The presentation will be in German.

Rumors are that we will see a real merge via EGit on this event:-) Hope to see you at their.

Local Mylyn tasks distributed via git

Thursday, August 26th, 2010

I learned from Steffen Pingel and Ekkehard Gentz that Mylyn has the ability to save local tasks outside the workspace. This is hidden under advanced in the Preferences.

This allows you to put your local tasks outside your workspace and versionize them with git. This way you can use git to move your local tasks between machines. I really like this as I frequently use different machines and now I can not only share source code betwee them but also my mylyn taslks.

As Steffen told me, simultanous access to the Mylyn tasks might cause task corruption but I don’t think that is an issue for me as Git takes care of conflicts and I do not have two machines writing to the same local file.

Fun times with Git and Mylyn!

Git – Cloning and pushing via https (Linux and Windows)

Monday, August 9th, 2010

Unfortunately the Eclipse team provider EGit does currently not support to use HTTPS for cloning and pushing.

Fortunately the Git command line supports this (under Linux without problems).

git clone https://vogella@github.com/vogella/de.vogella.rcp.example.git
// do some changes
git push https://vogella@github.com/vogella/de.vogella.rcp.example.git

If you are on Windows and if you are using msysGit then you may receive the following error:

error: error setting certificate verify locations:
CAfile: /bin/curl-ca-bundle.crt
CApath: none
while accessing your_repo

If you have this error you can disable ssl verification to solve it.

git config --global http.sslverify "false"

After this change cloning and pushing works via https on Windows.

Alternative the following should also make msysGit work, but I didn’t test these approaches.

copy C:\Program Files\Git\bin\curl-ca-bundle.crt to c:\bin\curl-ca-bundle.crt

or

 git config --system http.sslcainfo \bin/curl-ca-bundle.crt

The full discussion of the msysGit issue can be found here.

[Update:] If you are behind a http proxy you can set the proxy via the following command:

 git config --global http.proxy http://proxy:8080
// To check the proxy settings
git config --get http.proxy

Eclipse e4 git mirror

Tuesday, July 20th, 2010

After some time and effort mainly by Denis Roy and Bernhard Merkle the e4 git mirrors are working.

You find the e4 repos listed Eclipes Git overview.

EGit is also kind enough to be able to import all the projects from the different levels of the projects.

So give it a try via EGit and check out the e4 source code, e.g. the e4 UI projects via git://dev.eclipse.org/org.eclipse.e4/org.eclipse.e4.ui.git or if you want to use http via http://dev.eclipse.org/git/org.eclipse.e4/org.eclipse.e4.ui.git.

Checking out EGit source code with EGit

Friday, February 12th, 2010

Git and EGit are getting popular. In case you want to start hacking on EGit this will give you some hints.

First install EGit following this guide EGit Tutorial.

First you need a few libraries from Orbit via cvs. The cvs location is “:pserver:anonymous@dev.eclipse.org/cvsroot/tools”. You need:

  • org.eclipse.orbit/com.jcraft.jsch
  • org.eclipse.orbit/org.kohsuke.args4j
  • org.eclipse.orbit/javax.servlet

See Libraries from Orbit for getting these libraries.

Select File -> Import -> Git -> Git Repository and paste the URL “git://egit.eclipse.org/jgit.git” into the first line.

Do the same with “git://egit.eclipse.org/egit.git”.

Currently there is a little bug in EGit, please see Bug Report. If you facing the problem that the Team operations are not available on your new project my EGit Tutorial describes what to do to make the Team operations available. This should be fixed very soon, path is already commited to the master branch.

You have now the source code in your workspace and can start hacking.

For more info please see the excellent EGit Contributor Guide.

Getting the Eclipse source code via Git

Tuesday, November 24th, 2009

Eclipse recently started to provide Git mirrors of the cvs repositories.You find the location of the Git repository on the following website Eclipse Git repositories.

If you have the git commad line tools installed (Ubuntu: sudo apt-get git-core) you can use the following command to check these repositories out from the command line:

git clone url

for example to get the JFace snippets use the following command.

git clone git://dev.eclipse.org/org.eclipse.jface/org.eclipse.jface.snippets.git

After that checkout you can import the project into Eclipse via File -> Import -> General -> Existing Project into Workspace.

Of course you can use the EGit plugin to checkout Git repositories directly in Eclipse. Check the excellent EGit User Guide for this.

Via Git we have another nice option to get the Eclipse source code in additon to cvs and svn. :-)

I believe Git does currently not support Project Set Files (.psf) similar to cvs to get a consistent set of plugins but at least individual plugins can be checked out.

Update I have created a small introduction to Git Git Tutorial and to EGit Git with Eclipse – EGit Tutorial. Hope this helps.


Switch to our mobile site