Version control with Git
This post outlines the essential commands for placing your code under version control with Git. I assume you have installed Git, if not see Pro Git for information on how. I recommend the Git Reference as a good summary of the Git commands. Initial setup After installing Git setup your environment: git config --global user.name "Your Name" git config --global user.email your.email@foobar.com New repository setup Change directories to the root directory of your project and initialise a new repository: git init Now you can see that there is .git directory in your project. Git uses a .gitignore file to control which files to ignore when adding to the repository. In my example I am using a Rails application and that file was automatically generated for me when I created the Rails application. Edit the .gitignore file to your liking: # Ignore bundler config /.bundle # Ignore SQLite database. /db/*.sqlite3 # Ignore logfiles and tempfiles. /log/*.log /tmp ...