ä»æ´ã§ããgitå ¥é
ãµã¨iPhoneã®ãµã³ãã«ã³ã¼ãã¨ãå
¥ãã¦ããã¨ä¾¿å©ããªã¨æãã使ã£ã¦ã¿ãããªã£ãã®ã§ç°å¢ãæ´ãã¦ã¿ã¾ããã
ã¤ã³ã¹ãã¼ã«
gitã®ãµã¤ãããv1.6.2.3ã®ã½ã¼ã¹ãåå¾ãã¦ã¤ã³ã¹ãã¼ã«ã
$ tar zxvf git-1.6.2.3.tar.gz $ mv git-1.6.2.3 /usr/local/src $ cd /usr/local/src/git-1.6.2.3 $ ./configure --prefix=/usr/local/git $ make $ sudo make install
githubã«ç»é²
ã¢ã«ã¦ã³ãã¯å°ãåã«ä½ã£ã¦ããã®ã§sshé¢é£ããã
1. public key ãç»é²
ã¢ã«ã¦ã³ããã¼ã¸ããpublic keyãç»é²ãã¾ããpublic keyã¯ä»¥åä½ã£ã¦ãããã®ããã®ã¾ã¾å©ç¨ãã¦ãã¾ããさくらサーバでsvn+sshを利用する方法(Linux/Mac)
2. ~/.ssh/config ãä½æ
Host github.com User git Port 22 Hostname github.com IdentityFile ~/.ssh/your_id_dsa TCPKeepAlive yes IdentitiesOnly yes
3. ã¬ãã¸ããªä½æ
dashboardã®create new oneããã¬ãã¸ããªãä½æã
ProjectName: iphone-samples Description: iPhone programming samples.
ä½æããã¨èª¬æãã§ã¦ããã®ã§ãã®éãã«å®è¡ãã¾ããã
$ git config --global user.name "your name" $ git config --global user.email [email protected] $ mkdir ~/Desktop/iphone-samples $ cd ~/Desktop/iphone-samples/ $ git init $ touch README $ git add README $ git commit -m 'commit test.' $ git remote add origin [email protected]:ntaku/iphone-samples.git $ git push origin master
ããããã¡ãã»ã¼ã¸ãåºã¦ç¡äºããã·ã¥å®äºã
githubã§åç
§ããã¨ãã¡ã¤ã«ã追å ããã¦ãã¾ããã
gitã«æ £ãã
ã¨ããããgithubã¯åé¡ãªã使ããããªæããªã®ã§ãgitã«æ
£ããããã«è²ã
試ãã¦ã¿ã¾ããã
ãã¼ã«ã«ã¬ãã¸ããª
ã¾ãã¯é©å½ã«ã¬ãã¸ããªãä½æãã¦ãã¡ã¤ã«ãã³ãããã
$ mkdir local_git $ cd local_git $ git init // ã¬ãã¸ããªåæå $ touch readme $ git add . // ãã¡ã¤ã«ãå ¨ã¦è¿½å $ git status // å¤æ´ãã¡ã¤ã«ãç¢ºèª $ git commit -m 'first commit' // ã³ããã $ git log // å±¥æ´ã確èª
å¥ã®ãã©ã³ããä½æãã¦masterãã©ã³ãããåãæ¿ãã
(SVNã¿ããã«trunkã¨ããæ¦å¿µã¯ãªãã¦å
¨é¨ãã©ã³ã)
$ git branch 20090417 // ãã©ã³ãã追å $ git checkout 20090417 // ãã©ã³ããåãæ¿ã $ git branch // ãã©ã³ããåãæ¿ãã£ã¦ãããã¨ãç¢ºèª $ echo 'test' > readme // ãã©ã³ããä¿®æ£ $ git commit -a -m 'commit from branch' // ã³ããã $ git checkout master // masterã«åãæ¿ã $ git merge 20090417 // ãã©ã³ãã®ä¿®æ£ããã¼ã¸
ã¿ã°ãä»ãã¦ã¿ãã
$ git tag -a tag_20090417 -m 'add tag' // ã¿ã°è¿½å $ git tag -l // ã¿ã°ä¸è¦§
ã¿ã°ãã¢ã¼ã«ã¤ããã¦åå¾ãã¦ã¿ãã
$ git archive --format=zip master tag_20090417 > ~/tag.zip
ãªã¢ã¼ãã¬ãã¸ããª
ãã¼ã«ã«ç°å¢ã«è¤æ°ã¬ãã¸ããªãä½æãã¦ãªã¢ã¼ãã¬ãã¸ããªã試ãã¾ããã
ãªã¢ã¼ããã©ã³ãã¯ãã¢ã¬ãã¸ããªã¨ããå½¢ã§ä½æã
$ mkdir remote_git $ cd remote_git $ git --bare init
ãã¼ã«ã«ã¬ãã¸ããªã®ä¿®æ£å
容ããªã¢ã¼ãã¬ãã¸ããªã«åæ ãããã
$ mkdir local_git $ cd local_git $ git init $ git remote add origin ~/Desktop/remote_git // ãªã¢ã¼ãã¬ãã¸ããªãæå® $ git remote show origin // ä¸è¨ã¬ãã¸ããªã®æ å ±ã表示 $ touch readme $ git add . $ git commit -m 'first commit' // ãã¼ã«ã«ã¬ãã¸ããªãæ´æ° $ git push origin master // 対象ãã©ã³ããæå®ãã¦ããã·ã¥
å¥ã®ãã¼ã«ã«ãªãã¸ããªãä½ã£ã¦æ´æ°å
容ãåå¾ããªã¢ã¼ãã¬ãã¸ããªã®æ´æ°ã確èªããã
$ mkdir local_git2 $ cd local_git2 $ git init $ git pull ~/Desktop/remote_git $ git log
æä½é使ããããã«ãªã£ãã®ã§ãããªæãã§çµäºã§ãã
ãã®ä»ã¡ã¢
$ git config --list // configã®å 容ãç¢ºèª $ git push [remote repo] [my repo] // ãã©ã³ãã®ååããã·ã¥ $ git push [remote repo] // ï¼åç®ä»¥éã®ããã·ã¥ $ git config --global color.diff auto // ã«ã©ã¼è¨å® $ git config --global color.status auto $ git config --global color.branch auto