I m using Git for about half a year and boy it still amazes me with these little “gems” that you can find “inside”.
At the beginning I just hated the idea of a console management. I was using Svn with tortoise installed. Yeah those are symptoms of a “Windows User” which only knows how to point and click with mouse. Everything changed when I thought that it would be a great idea to learn Git . there was a huge hype , well it still here. I installed msysgit and started my journey.
Git changed everything . I just love the idea of managing a lot of things without the mouse. learning Git encouraged me to learn shortucts and keyboard commands in my “default” IDE (Visual Studio + R%). It’s a huge productivity boost and there is a cool side-efect. Work is more is fun : ).
I spent couple of months managing my project by console. You know
git commit , git push . I even learned some vim which is also cool and “nerdy”.
Then I discovered git gui. This simple app is almost everything you need to manage your git based repository.
To run it write “git gui” in the console.
Right now my standard scenario when pushing new commit is :
– review changes and prepare commits in git gui
– push changes to repo by the git push command in the console .Yeah I know that you can push from within git gui but a simple command in console is a lot easier to do (truth is I don’t know how to configure it ). I have two instances of msysgit running all the time.
Staging selected lines
When coding we sometimes forget to commit every “bigger” change. Big pile of changes with different functionalities emerges and we have the problem. We could commit everything in one try but that’s not a good idea. In ideal scenario commits should contain only one functionality. That way every revision is a functional app ready to clone and test. With one big commit , repository is not “flexible”.
There is a solution for it called “Stage Lines for Commit”. You just need to run git gui select changes inside git gui and right click then there is a option to commit only selected lines of code.
Git is full of little gems. It’s easy , it’s fun. It’s just great ;]
I started my adventure in Source Code Management systems with SVN. I was on my 3rd year at University and was quite impressed with it’s capabilities. Later on after hearing a lot of good things about Git and watching great presentation by Linus Torvalds, I persuaded myself to try it. This was a big move for me. I worked/learned on the MS stack so by moving to the GIT world I had to learn some Unix technology. I had problems with adoption : configuration problems , shift in thinking about repositories , branches , even something new like GitHub community. Lots of work and try and error learning but it was worth the time . Now , which is an irony , I have problems working with SVN at work Too much “git-ing” : ) . You just cant understand why something is in GIT and not in SVN. I m struggling now. Integration server is full of “build failures , caused by missing file in repository : D
I m still working with GIT at home , and I m not changing it to other SCM unless it’s really necessary eg. in work.
Recently I encountered a problem with ignoring files. I wanted to ignore some files by extension type. Well I was not working at all. I had to spent some time to find the solution. StackOverflow came to the rescue. Those simple commands fixed my problem.
git rm -r --cached .
2. git add .
3.git commit –m
This basically clears out the cache and “re-adds” files.
On a side note don’t be afraid with the git rm command , I have almost jumped off my chair when I saw whole thesis being deleted : )