Home > Coding Tips > Using Git for Document/Software Version Control

Using Git for Document/Software Version Control

January 27th, 2010 Leave a comment Go to comments

I had been using my own ad-hoc system for years but recently started using CVS to maintain a history of my file and document changes. I was quite happy with CVS but everyone told me I should be using Git instead.  Git seems to be simpler and more intuitive. I can set up git for a folder or project very quickly. You just need the following 5 commands to get going

git init       (set up git for the current directory)
git add *.php   (add all your php files or whatever)
git commit -m “first version”    (also need to commit all your existing php files)
vi index.php (make a few changes)
git commit -a -m “Added new date feature”   (do this periodically to maintain version control)

gitk is a simple TK Gui which allows you to review you versions etc. I am delighted to have version control, all I have to do is remember to do a > git commit -a -m “Added new date feature” every now and again (eg daily)