Posts Tagged ‘git’

Setup Capistrano to deploy Rails application on Amazon EC2 with Git

1: Create a new Rails app – we’ll call is ‘deploytest’
$ rails deploytest
$ cd deploytest
2: Create a local Git repository for it
$ git init
$ git add *
$ git commit -a -m ‘initial commit’
$ git status
3: Create a couple of Capistrano files
$ capify .
4: Edit config/deploy.rb
# The name of your app
set :application, “deploytest”
# The directory on [...]

Install Git on MAC Tiger (10.4.11)

I downloaded and compiled the latest Git version, 1.6.2.3 like so:

curl -O http://kernel.org/pub/software/scm/git/git-1.6.2.3.tar.gz
tar jxvf git-1.6.2.3.tar.gz
cd git-1.6.2.3
make prefix=/usr/local all
make prefix=/usr/local test && echo $?
sudo make prefix=/usr/local install

When the compile was done, it gave me output like this:

!! You have installed git-* commands to new gitexecdir.
!! Old version git-* commands still remain in bindir.
!! Mixing two versions [...]

Keep either file in merge conflicts with git

So, the scenario is: you’re in the middle of a merge, and you want to keep one file or the other.
$ git merge master
Auto-merged _layouts/default.html
CONFLICT (content): Merge conflict in _layouts/default.html
Auto-merged index.html
CONFLICT (content): Merge conflict in index.html
Automatic merge failed; fix conflicts and then commit the result.
There’s [...]

Setting up a new remote git repository

For the impatient
Set up the new bare repo on the server:
$ ssh myserver.com
Welcome to myserver.com!
$ mkdir /var/git/myapp.git && cd /var/git/myapp.git
$ git –bare init
Initialized empty Git repository in /var/git/myapp.git
$ exit
Bye!

Add the remote repository and push:
$ cd ~/Sites/myapp
$ git remote add origin ssh://myserver.com/var/git/myapp.git
$ git push origin master
Set the local master branch to track the remote branch.
Read further [...]