User Tools

Site Tools


it:git

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
it:git [2012/01/05 11:51]
Alexander Rind egit setup guide final step
it:git [2014/06/30 16:59]
Alexander Rind new section: Rename files throughout history
Line 11: Line 11:
  
 ===== Setup with Eclipse and GitHub ===== ===== Setup with Eclipse and GitHub =====
- 
-This guide is work-in-progress. I will refine the finally step while walking through with one of you. 
  
   - GitHub account   - GitHub account
Line 21: Line 19:
     * you probably already have a keypair (e.g., for your [[subversion]] setup).     * you probably already have a keypair (e.g., for your [[subversion]] setup).
     * in Eclipse you can create or manage SSH keypairs ​     * in Eclipse you can create or manage SSH keypairs ​
-      * Eclipse ​-> Preferences -> General -> Network Connections -> SSH2+      * Window ​-> Preferences -> General -> Network Connections -> SSH2
       * on Windows I have my SSH home in ''​C:​\Users\Rind\AppData\Roaming\ssh''​ and NTFS-encrypted this directory       * on Windows I have my SSH home in ''​C:​\Users\Rind\AppData\Roaming\ssh''​ and NTFS-encrypted this directory
       * see also [[http://​wiki.eclipse.org/​EGit/​User_Guide#​Eclipse_SSH_Configuration]]       * see also [[http://​wiki.eclipse.org/​EGit/​User_Guide#​Eclipse_SSH_Configuration]]
     * copy/paste the public key to your GitHub profile at https://​github.com/​account/​ssh     * copy/paste the public key to your GitHub profile at https://​github.com/​account/​ssh
   - EGit    - EGit 
-    * install "EGit - Git Team Provider"​ from the Eclipse Marketplace +    * install "EGit - Git Team Provider" ​ 
-  - clone the repository to your computer and (add it to Eclipse +      * either ​from the [[Eclipse#​eclipse_marketplace | Eclipse Marketplace]]  
-    - in Eclipse select File -> Importthen Git -> Projects from Git +      * or from their update site: ''​%%http://​download.eclipse.org/​egit/​updates/​%%''​ 
-    - Clone +  - clone the repository to your computer and add it to Eclipse 
 +    - in Eclipse select File -> Import ​ 
 +    - then Git -> Projects from Git 
 +    - Select Repository Source: "​URI"​ 
 +    - Source Git Repository
       * URI: ''​git@github.com:​ieg-vienna/​Prefuse.git''​       * URI: ''​git@github.com:​ieg-vienna/​Prefuse.git''​
       * you don't need to change anything else!       * you don't need to change anything else!
       * leave user "​git"​ and password ""​!       * leave user "​git"​ and password ""​!
-    - select a directory where Git should store local repositories +    ​- Branch Selection: leave all branches selected 
-      ​this should be outside your Eclipse workspace directory! +    ​- select a directory where Git should store local repositories ​(only at first use) 
-      ​I use ''​C:​\Users\Rind\git''​ +      ​this should be outside your Eclipse workspace directory! 
-    - in the "Wizard for project import"​ select ​"​Import existing project"+      ​I use ''​C:​\Users\Rind\git''​ 
 +    - Local Destination:​ accept default values  
 +    - Setup Eclipse project 
 +      * If there are Eclipse project files in the repository; i.e. "Finish" ​is not grayed out. \\ Example: prefuse-vienna 
 +        - Import existing project 
 +      * Otherwise. \\ Examples: EvalBench, TimeBench, ieg-util, ieg-prefuse 
 +        - Import as general project 
 +        - close project in Eclipse 
 +        - manually copy eclipse.project to .project and eclipse.classpath to .classpath \\ If this does not work in Windows Explorer, the Windows Commandline or a [[http://​notepad-plus-plus.org/​ | good text editor]] can be used. 
 +        - reopen project in Eclipse 
 +      * The 3rd option (new project wizard) fails.
  
 __Note__: for contribution development EGit will be sufficient -- you do **NOT** need //Git for Windows// __Note__: for contribution development EGit will be sufficient -- you do **NOT** need //Git for Windows//
Line 42: Line 54:
 __Note__: I wrote this guide for Eclipse IDE for Java Developers Helios SR2, but it should also work for other versions. __Note__: I wrote this guide for Eclipse IDE for Java Developers Helios SR2, but it should also work for other versions.
  
 +===== Work git on the client and Subversion on the server =====
 +
 +Initial Checkout:
 +<code bash>
 +git svn clone svn+ssh://​svn.isis.tuwien.ac.at/​home/​HypoVis/​repository/​Theses/​TimeBench
 +</​code>​
 +
 +Work with ''​git''​ as you like, include branches and rebasing.
 +
 +Commit to server:
 +<code bash>
 +git svn dcommit
 +</​code>​
 +
 +Update from server:
 +<code bash>
 +git svn rebase
 +</​code>​
 +
 +Might be relevant: [[http://​stackoverflow.com/​a/​10762396/​1140589 | git-svn to handle eol-style]]
 +
 +Alternative:​ http://​subgit.com/​
 +
 +===== Attach a new pull request to an existing issue on GitHub =====
 +
 +<code bash>
 +curl --user "​alex-rind:​XXXXX"​ \
 +       ​--request POST \
 +       ​--data '​{"​issue":​ "​16",​ "​head":​ "​alex-rind:​character-encoding",​ "​base":​ "​master"​}'​ \
 +       ​https://​api.github.com/​repos/​prefuse/​Prefuse/​pulls
 +</​code>​
 +
 +XXXXX -> GitHub web password \\
 +character-encoding -> branch name
 +
 +Source: http://​stackoverflow.com/​questions/​4528869/​how-do-you-attach-a-new-pull-request-to-an-existing-issue-on-github#​answer-4529172
 +
 +===== Rename files throughout history =====
 +
 +<code bash>
 +git filter-branch --index-filter '
 +git ls-files -s | \
 +sed "​s-\t.classpath-\teclipse.classpath-"​ | \
 +sed "​s-\t.project-\teclipse.project-"​ | \
 +GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index --index-info && \
 +mv "​$GIT_INDEX_FILE.new"​ "​$GIT_INDEX_FILE"​
 +' HEAD
 +</​code>​
  
 +Source: http://​www.fussylogic.co.uk/​blog/?​p=1250
 ===== Further Readings ===== ===== Further Readings =====
  
it/git.txt · Last modified: 2015/11/25 10:14 by Alexander Rind

alex @ ieg: home about me publications research