Tuesday, September 21, 2010

Simple Git example for SVN users


In my case, using Git for the first time wasn't exactly a picnic, being so used to SVN. The learning curve was steep and requires a lot of thorough reading plus research (i.e Google). IMHO, it doesn't have the up-and-get-go ease of use as SVN, understandable as Git is far more advance.



So here's another Git guide for SVN users, albeit a simple one. Here, the central Git repository is hosted at GitHub and the OS used is Linux.



Say you have a GitHub a/c with u/p : myname/mypassword.



To access GitHub, create the SSL as described here.



Set global git parameters so you can execute commands without being asked for passwords and what not. For the user name and email, use the same one when you registered with GitHub.


git config --global user.name "myname"
git config --global user.email your_email@some_domain.com



Get a fresh copy of your repository from GitHub. In this case the GitHub url for the repository is git@github.com:some_user_name/RepositoryName.git. After this, a new directory called RepositoryName will be created. 'cd' into it so you may execute the rest of the git relevant commands.


git clone git@github.com:some_user_name/RepositoryName.git
cd RepositoryName



From here, begins your usual edit/compile/test cycle.



To see which files have been modified/added/deleted, you can use either of these:


git status
git diff --color



To commit a modified file, type the following. Note that unlike SVN, this does not go to the GitHub repository.


git commit app/views/projects/show.html.erb -m "fixed some bug"



To commit a new file, type the following. This also does not go to the GitHub repository immediately like in SVN.


git add app/views/projects/form.html.erb
git commit app/views/projects/form.html.erb -m "added new form"



To push what you've just committed to the GitHub repository:


git push



To get updates from the GitHub repository:


git pull



Hope that helps, especially when you're used to the SVN way of doing things.



Of course, do Google around for more info. There's tons out there.

Wednesday, May 5, 2010

The security header is not valid

Regarding Paypal API credentials, here's a summary to avoid confusion:

* If you're using SANDBOX mode, you need to use a SANDBOX account API credentials.
* If you're using LIVE mode, you need to use a LIVE account API credentials.

If you use a LIVE account to test in Paypal's SANDBOX environment, Paypal will respond with "The security header is not valid" and vice versa.

There must be a good reason why the returned message is so vague.