Hosting Git on GitHub and Dreamhost (Mac OS X & Windows)

11,12,2010 at 20:20 Yorum bırakın

<![CDATA[

Installing Git on Mac OS X

Installing the latest version of Git on OS X is pretty easy.

  1. Go to http://code.google.com/p/git-osx-installer/downloads/list and download/install the suitable version for your system (I downloaded git-1.7.3.3-x86_64-leopard.dmg)

Setup GitHub Repository

	Username: "goksel"
	E-mail : "goksel@gmail.com"
	Project Name: "project"
	Remote Project Url : "git@github.com:goksel/project.git"
	Local Project Folder : "/Library/WebServer/Documents/project"

We are ready to setup our Repo:

  1. 			git config --global user.name "Goksel Eryigit"
    			git config --global user.email "goksel@gmail.com"
    			ssh-keygen -t rsa -C "goksel@gmail.com"
  2. 			cat ~/.ssh/id_rsa.pub | pbcopy
  3. Go to GitHub Account Settings > SSH Public Keys > Add another public key and paste the key you copied to key field.
  4. 			cd /Library/WebServer/Documents
    			git clone git@github.com:goksel/project.git

Setup Dreamhost Git Repository

	SSH User: "goksel"
	Host: "geryit.com"
	Project Name : "project"
	Remote Repo Location : "/~/git/project.git" (means "/home/goksel/git/project.git")"
	Local Repo Location : "/Library/WebServer/Documents/project"

We are ready to setup our Dreamhost Repo:

  1. 			git config --global user.name "Goksel Eryigit"
    			git config --global user.email "goksel@gmail.com"
    			ssh-keygen -t rsa
  2. 			scp ~/.ssh/id_rsa.pub goksel@geryit.com:~/
  3. 			ssh goksel@geryit.com
  4. 			mkdir .ssh
    			cat id_rsa.pub >> .ssh/authorized_keys
    			rm id_rsa.pub
    			chmod go-w ~
    			chmod 700 ~/.ssh
    			chmod 600 ~/.ssh/authorized_keys
    			eval `ssh-agent`
    			ssh-add
  5. 			mkdir git
    			mkdir git/project.git
    			cd git/project.git
    			git --bare init
    			exit
  6. 			cd /Library/WebServer/Documents
    			git clone ssh://goksel@geryit.com/~/git/project.git

Installing Git on Windows

We will install 3 software to run Git; Msysgit (Basic Git Tool), TortoiseGit (Git Client for Windows) and Putty (Helps us to SSH to Remote)
  1. Download and install Msysgit.

  2. Download and install TortoiseGit.

  3. Download and install Putty (Find Installer Version)

  4. Run Git Bash

  5. Run these commands:

    			git config --global user.name "Your Name"
    			git config --global user.email your-github-email@email.com
    		

    Now your Git username and email is created on your local.

  6. Now run Pageant and Puttygen, generate keys, copy Public Key, save Private Key in Putty Format (ppk) to a safe place and add to Pageant.










GitHub

  1. Go to GitHub, create a project, go to Account Settings > SSH Public Keys > Add another public key and paste key into key field and hit Add Key.




  2. Go to github.com, get your github remote git url and clone your repo (by right click on local) to your local server with tortoisegit





Git on Dreamhost

There are two connection ways that you can setup your repository on Dreamhost: Html (WebDav) and SSH

WebDav

Webdav allows more then one user to push to the same repo but also slow.

There are two great posts that will help you to setup your repo:
http://priodev.blogspot.com/2010/02/hosting-your-git-repository-on.html and http://www.travisberry.com/2009/11/running-a-git-repo-on-dreamhost

SSH

I give the commands that will help you a lot. My SSH username is “goksel”, Remote Host is “geryit.com” and I will run my Remote Repo at “~/git/project.git” so I SSH with Git Bash (or Terminal) and :

	ssh-keygen -t rsa
	scp ~/.ssh/id_rsa.pub goksel@geryit.com:~/
	ssh goksel@geryit.com
	mkdir .ssh
	cat id_rsa.pub >> .ssh/authorized_keys
	rm id_rsa.pub
	chmod go-w ~
	chmod 700 ~/.ssh
	chmod 600 ~/.ssh/authorized_keys
	eval `ssh-agent`
	ssh-add
	mkdir git
	mkdir git/project.git
	cd git/project.git
	git --bare init
	exit
	git clone ssh://goksel@geryit.com/~/git/project.git

You must see a project folder on your local server after clone command.

If you want your changes to be deployed on a live site you should play with hook files (On remote, under project.git/hooks)

Some very helpful posts

https://github.com/multitheftauto/multitheftauto/wiki/how-to-use-tortoisegit
http://wiki.dreamhost.com/Git
http://craigjolicoeur.com/blog/hosting-git-repositories-on-dreamhost
http://priodev.blogspot.com/2010/02/hosting-your-git-repository-on.html
http://www.travisberry.com/2009/11/running-a-git-repo-on-dreamhost/
http://chosencollective.com/technology/using-git-hooks-push-live-website
http://effectif.com/nesta/publishing-articles-with-git

If you want to run an SVN Repo on Dreamhost please visit https://goxel.files.wordpress.com/2010/12/tortoisegit41.png2010/07/auto-update-svn-on-dream-host/

]]>

Reklamlar

Entry filed under: Tutorials. Tags: , , .

Pure CSS3 box-shadow page curl effect Get last.fm Top Weekly Artist Chart to your Web site with PHP

Bir Cevap Yazın

Aşağıya bilgilerinizi girin veya oturum açmak için bir simgeye tıklayın:

WordPress.com Logosu

WordPress.com hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap / Değiştir )

Twitter resmi

Twitter hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap / Değiştir )

Facebook fotoğrafı

Facebook hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap / Değiştir )

Google+ fotoğrafı

Google+ hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap / Değiştir )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Takvim

Aralık 2010
P S Ç P C C P
« Kas    
 12345
6789101112
13141516171819
20212223242526
2728293031  

Most Recent Posts


%d blogcu bunu beğendi: