Rails project works well with Git. A .gitignore file can be found in a freshly created Rails project. It would be good to setup the local Git repository before you start the development.
1. First, install Git
- apt-get install git-core
2. Setup your Git user account.
- git config –global user.name “Your Name”
- git config –global user.email firstname.lastname@example.org
3. Also setup the default text editor for Git.
- git config –global core.editor “vi”
4. Go to your Rails project root directory and add the following ignore paths in the .gitignore file.
# Default ignore paths .bundle db/*.sqlite3 log/*.log tmp/**/* # Newly added *.log tmp/* doc/api doc/app *.swp *~ .DS_Store
5. Initialize the local Git repository.
- git init
6. Go to the Rails project root folder and add all files to the local Git repository.
- git add .
7. Compare the working tree with the repository. There will be many new files which we just added.
- git status
8. Commit all the newly added files.
- git commit -m “First commit =)”
9. Check the status again, there should be nothing to commit. You can also check the commit log by the git log command.
Reference: Ruby on Rails Tutorial – 1.3 Version control with Git
2 thoughts on “Git – Initialize your Local Git Repository”
I’m not sure if you can help me with this at all. To make a LONG story short: I’m attempting to jailbreak my kindle (3gb wi-fi) & in order to do that I need to set up SSH key access. I have NO knowledge of code & after trying this for 1.5 days (searching the internet for hours & rebooting my kindle too many times to remember) I figured it was time to ask someone who knows about computers (whew!). Anyway, I’m using GitHub (http://help.github.com/win-set-up-git/) & it says failed everytime I try to generate a new SSH key.
These are some of the codes I’ve tried entering:
(/Users/C/Documents and Settings/CRW/My Documents/.ssh/id_rsa):
Can you PLEASE help me out. . . what am I doing wrong?
you are using windows, rite?
This post should help.
Git – Generate Public Key for GitHub Using msysgit