Showing posts with label version control. Show all posts
Showing posts with label version control. Show all posts

Thursday, March 29, 2012

Overview Git commands

As I mentioned in my first Git-post I wanted to prepare a nice overview for the Git commands, so you can print it and put it next to your PC or keep it in your pocket ;)
Unfortunately the people at GitHub didn't answer my question if I may publish it. Because I didn't want to wait any longer and because I wanted to give it to you guys I made sure it fits the German citation laws.

So, here you go: http://goo.gl/eUyIu

If you find any mistakes or have an idea for improvements please let me know.

Friday, March 23, 2012

Experiences with local Git and Eclipse

Some weeks ago I wanted to learn a little bit about Git because it is quite a buzzword. I already knew how to work with SVN and CVS, so I thought that it couldn't be very different.
I won't list any differences between those here. You can find out by yourself (and you are encouraged to do so ;) ).
What was really useful for me, was, that it is pretty easy to put a local folder under Git control. Just installing Git, adding it to the PATH-variable and that's all the preparation you need.
After that, just switch into a directory you like and type:
git init
Now your folder is under version control. (if you type into your shell ls -la you'll see the new .git folder)
If you put some files into that directory and add them with  
git add
and commit them with
git commit
Now you can keep track of your changes.
Of course, if your hard disk gets broken Git won't have any use for you. But one possibility would be to add a folder to Git (as described before) on an external hard disk or an usb-drive and then, on your hard disk, call
git clone "path to the external drive"
Now you are able to store your changes there and, depending on how you treat your hardware ;) , keep them quite safely.

Another nice advantage is, that you can put your existing Eclipse projects under version control and then use EGit. You only have to remove those projects from Eclipse, call git init on them and add the repository to Eclipse (under Git repository view). Now you can import them from the repository view.
It'll look like this:
EGit showing some repositories, including the local one

Last week I accidentally deleted a src-folder from one of my projects because I didn't read the Eclipse dialog, if I was sure about doing that. What a luck that folder was under my local version control. I was able to restore everything (of course except for my last changes).


It gotta thank the people of http://gitref.org/ because that website is a really good overview for the different commands. I'll try to shorten those commands a little bit, so that they fit one piece of paper and put that file up, so everybody can print it, as kind of short reference. But before I do that, I will ask the gitref people because I used their website.


 

Copyright @ 2013 Wrong tracks of a developer.

Designed by Templateiy