Category Archives: How-to

Migrate svn to git repo from a local svn reposiroty

This is a how to migrate a svn repository or repository folder to git when you have full control on the svn repository.

  • I started to create a directory where I’ll do the job, (you can do the work where your current repo is located. you need svn and git to be installed on the machine)

mkdir C:\Temp\svn_migration

  • copy your repo in there, you should have something like this

svn_micgration_1

  • create a authors.txt file in the conf folder, copy the user from the passwd file

the structure of passwd file is sthg like

user = password

create a new authors.txt file in C:\Temp\svn_migration and use this layout. only the left hand side of the equal is relevant for us. (for the example above : user)

user = aName aLastName <auser@example.com>

  • start svnserve : from a cmd prompt, start the svnserve.exe for your repo. svnserve comes with subversion installation, but also with tortoisesvn.

"C:\Program Files (x86)\Subversion\bin\svnserve.exe" -d -R --root C:/Temp/svn_migration/svn_repository

  • start the migration. just issue the following command in C:\Temp\svn_migration

git svn clone svn://localhost/path/to/your/repo --no-minimize-url --no-metadata -A authors.txt someFolderName

note : The --no-minimize-url makes sure that git svn only clones the specific directory without trying to clone the root of the repository.

  • add a remote and push : finally you want to share it with other so:

cd to your git repo C:/Temp/svn_migration/someFolderName then

git remote add origin https://yourRemotegiturl

git push --set-upstream origin master

 

 

 

 

once upon Git commands

Shortcuts to some usefull Git commands used in day to day work

//create a branch
git branch <branch_name>

//set us currently on a specific branch
git checkout <branch_name>

//shortcut for all that
git checkout -b <branch_name>

//push branch to origin 
git push -u origin <branch_name>

//delete local branch
git branch -d <branch_name>

//delete branch remotely
git push origin --delete <branch_name>
git push origin :<branch_name>

when a fix has been done on the master branch and you want the changes from that master in your branch. The best approach, in my opinion. after you done all commit in your local “feature, fix…” branch locally (and remotely)

master     : ---A---B---C--------G
                         \        \
branch-bis :              \        H--I---J---K ....
                           \         /
branch     :                D---E---F

//1. set ourselves in the master branch and pull changes locally
git checkout master
git pull

//2. create a new branch locally and optionally remotely
git checkout -b <branch_name_bis>
git push -u origin <branch_name_bis>

//3. merge changes from the original branch we want 
// the master changes merge to,
// and optionaly delete it locally and remotely
git merge <branch_name>
git branch -d <branch_name>
git push origin :<branch_name>

Configure camel -openwebbeans – deltaspike to get a standalone camel application running with cdi

here are code snippet to get camel, OpenWebBeans container and deltaspike .

  • The code that boots the app
  org.apache.camel.cdi.Main maincdi = new org.apache.camel.cdi.Main(){};
  maincdi.run();
  • camel context producer
public class CamelContextFactory {

    @Produces
    @ApplicationScoped
    CamelContext customize() {
        DefaultCamelContext context = new DefaultCamelContext();
        context.setName("my-custom-camel-context");
        return context;
    }

    void cleanUp(@Disposes CamelContext context) {
        // ...
    }
}

Continue reading Configure camel -openwebbeans – deltaspike to get a standalone camel application running with cdi

Create a new git repository from one folder contained in another git repository

When your repository is becoming too big and you using git sparse checkout is not what you want because you just want to get rid of some folders but still want to keep the commit history, then you need to do the following :

for example, you have the following folder structure in Repo_A:

https://someserver/Repo_A.git
-> src
-> documentation
-> src-feature1

you want to put src-feature1 in another new git repo : Repo_B
Continue reading Create a new git repository from one folder contained in another git repository

Exploring GraphDB – Access Neo4J with .net driver (Create, Delete and Match)

Still on my path to

“what is GraphDB and what are its limitations… from the eyes of a developer”

I had to access it from code. I choose to do it in .net and first created a simple access library that I will surely evolve during my learning. (you can check it here : CExtensions-Cypher). I also created a feed for this on Myget : MyGet cextensions-cypher feed. As of this writing I used version 0.1.0-CI00001. (so early birds, be patient or contribute)

Note : You can also simply connect to Neo4j by just adding the package Neo4j.Driver.

If you want to use my library with VS2015, just add the feed in your Nuget Package Manager settings (Package sources) and add it to your project.
Continue reading Exploring GraphDB – Access Neo4J with .net driver (Create, Delete and Match)

VSIX Extension : how to add an icon to your command

This post explains how to add an icon to your VSIX extension.
(this was done using visual studio 2015 and relates to the following project : CExtensions-EFModelGenerator. see the Extension project)

A. Get a .ico file. You can create one or get a png file and find a converter online… there are plenty of them.

B. open your *.vsct file and add a GuidSymbol Element. To generate the guid : from file menu : Tools => Create Guid

 <GuidSymbol name="EfModelCommand_Icon_Symbol" value="{363F9640-FBB7-4403-AB20-9A53EA067ECA}">
      <IDSymbol name="EfModelCommand_Icon_ID" value="1" />
 </GuidSymbol>

To generate the guid : from file menu : Tools => Create Guid, select registry format, copy and paste it

create_guid

Continue reading VSIX Extension : how to add an icon to your command

How Do I manage my OSS builds and versioning with MyGet.org and Nuget.org

I write this post, because everytime I start a new project, I wonder what is the correct configuration. So I will keep things in sync from here.

1. Build with Myget

nota : I use Myget for my dev builds and nuget only for beta, rc and prod releases.

  • First create a new feed from www.myget.org => simply click on New Feed button

Create_feed
Continue reading How Do I manage my OSS builds and versioning with MyGet.org and Nuget.org