Git is a great distributed source code management (SCM) software developed by Linus Torvalds. Merging in git is simply awesome. I have used in the past subversion, cvs and VSS but now using Git extensively for small and large projects. It helps you to focus really on development rather than nuiances of typical SCMs.
Below is a step by step guide to setup Git on a Linux machine (My machine configuration is: Fedora Core 10, Kernel 2.6.30)-
1. Choose a folder where you want to keep all git repositories. I have placed all source code in /opt/git (say GIT_HOME)
2. Go to GIT_HOME. Create a new repository directory say Test.git. It is just a convention to put .git in the end of repository name.
3. Initialize newly created repository using "cd Test.git/; git --bare init"
4. Go to project folder which you want to put in git repository. Say, for ex Test inside /pawan/workspace/Test.
5. Initialize desired project folder using command "git init"
6. Add the newly created git repository inside Test/ using "git remote add origin ssh://localhost/opt/git/Test.git" (This assume you have already configured SSH)
7. Now, add desired folders and files in working project folder using "git add .". If you want to add only specific type of files, use "find . -iname "*.java" | xargs git add"
8. Commit all of your changes using "git commit -a -m "Initial version for Test.". Please change the message you want to change after -m.
9. Now, push the local code to repository using "git push origin master".
10.View the repository in gitweb and you will see your code inside git repository.
Visit http://git-scm.com/ for visual and written tutorials.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment