Git is a DVCS (Distributed Version Control System) designed by Linus Torvalds for the Linux kernel. It is designed to be an extremely fast source control management tool that scales from very small to quite large codebases. It is rapidly growing in popularity and is being used by a wide variety of open source projects, such as WINE, Ruby on Rails, Perl, git itself, and, of course, the Linux kernel.
Go to GitHub and set up an account.
On your computer, run the following:
git config --global user.name "John Smith"
git config --global user.email john.smith@example.com
Note: Make sure you set user.email to be the email you registered with for your GitHub account.
You will need to generate a public key. Inside of Terminal (or the Git Bash, for Windows users), run:
ssh-keygen -t rsa
Note: You don't need to enter a password if you think your computer is secure (ie. won't get stolen).
Go back to Github, and to your account settings. Under SSH Keys, paste the contents of the generated public key from above. (id_rsa.pub)
Send an email to Raf, containing the following information:
After getting access from Raf, run this
git clone git@github.com:rafd/SkuleMap.git
A common git workflow:
$ git clone git://some.git.repo.org/something.git $ cd something # Do some editing... # Then, see which files have been changed $ git status $ git add file1 $ git commit -m 'I made some changes to file1' # Send your changes back upstream $ git push
There are many other useful git commands worth learning such as git stash, git reset, etc. Other than the ones shown here, the most immediately useful are probably git branch, git checkout, and git rebase. Also, git add –interactive is insanely cool.
Here is a brief video your Wrench made, giving an example of using git add –interactive. Comment or email if you find it useful, and more will be made.
Q: When i push or pull an app, the data from the database in my local hard drive doesn't get pushed as well and i get an empty application online. How do i export the data too?
A: The data from the database probably isn't (and shouldn't be) in your repository: Typically, you only want source code in the repo. If you want to update the database as well, you'll need to export the data and transfer it separately. If your app happens to be on Heroku, you can easily do this using the “heroku db:push” command.
After pulling the project using git, you still need to tell Aptana that the folder is a project. The simple way to do this is to go to File→Import, under “Others” select “Existing Folder As New Project”. Browse to find the location of the folder and add the project name. Now you can access the project as usual with Aptana RadRails.