æ®éã®æç« ã Git ã§ç®¡çããã¨æ¥½ã ãã£ã¦è©±
西尾ããã奥ããã« Git ã使ããããããã
ãããå£å®ã«å¦»ã«gitãè¦ãããããã¨ãããç´ã®æ¹ã便å©ã ã¨è¨ããã¦èª¬å¾ããããªãã£ãã®ã§æä¼ã£ã¦ãã ããï¼(ã @yoshiori: æ ¡æ£ã®ããã« git 使ã£ããã©ä¾¿å©ãã ã¿ã㪠git ã§å稿ä¸ãã¦ãããã°ããã®ã«ï¼ï¼
ãªã®ã§ã¡ãã£ã¨ãã¼ã¸ã§ã³ç®¡çã¨ãã¦ã ãã§ã Git 使ãã¨æ¥½ã ãªãã¨æãã¨ãããæ¸ãã¦ã¿ããã
ãã西尾ããã¯å¤åè¤æ°ã§æ ¡æ£ã¨ãããæç« ã®è©±ãªãã ã¨æããã ãã©ãä»åã¯è¤æ°ã§ç®¡çã¨ãããããã¨ããã¯ãããã«ç´ç²ã«ä¸äººã§æç« æ¸ãã¨ãã Git 使ãã¨ä¾¿å©ã ãã£ã¦ãã¨ãæ¸ããããªãã¨æãã
æåã®ä¸æ©
æç« ã管çãããã£ã¬ã¯ããªã Git 管çä¸ã«ç½®ã
$ git init
Initialized empty Git repository in /Users/yoshiori/tmp/nishio/.git/
ã§ãç·¨éãã¦ã¨ãããã add ãã¦ã³ããã
$ emacs nishio.txt //ç·¨éãã $ git add nishio.txt git add nishio.txt $ git commit -m 'æç« æ¸ãå§ã' [master (root-commit) 384e4fb] æç« æ¸ãå§ã 1 files changed, 18 insertions(+), 0 deletions(-) create mode 100644 nishio.txt
ããã§ç®¡çä¸ã«ç½®ãããã®ã§å¥½ãã«æ¸ãã¦ãã
æç« æ¸ãã¦ãéä¸ã§ç¹å®ã®æè¨ãç½®ãæããããªã£ãããç½®ãæãã
ã£ã¦ããã¨ãã«ãç¹å®ã®æè¨ãç½®ãæããã®ã ãã¨ããããã³ããããããå ´å
git add -p ã§æå®ããã¨ä¾¿å©
$ git add -p diff --git a/nishio.txt b/nishio.txt index 151febf..e62e0f8 100644 --- a/nishio.txt +++ b/nishio.txt @@ -1,18 +1,32 @@ * æ®éã®æç« ã Git ã§ç®¡çããã¨æ¥½ã ãã£ã¦è©± -id:nishiohirokazu ã奥ããã« Git ã使ããããããã +西尾ããã奥ããã« Git ã使ããããããã // ãã¨ã§ link ãªã®ã§ã¡ãã£ã¨ãã¼ã¸ã§ã³ç®¡çã¨ãã¦ã ãã§ã Git 使ãã¨æ¥½ã ãªãã¨æãã¨ãããæ¸ãã¦ã¿ããã -ããid:nishiohirokazu ã¯å¤åè¤æ°ã§æ ¡æ£ã¨ãããæç« ã®è©±ãªãã ã¨æããã ãã©ãä»åã¯è¤æ°ã§ç®¡çã¨ãããããã¨ããã¯ãããã«ç´ç²ã«ä¸äººã§æç« æ¸ãã¨ãã Git 使ãã¨ä¾¿å©ã ãã£ã¦ãã¨ãæ¸ããããªãã¨æãã +ãã西尾ããã¯å¤åè¤æ°ã§æ ¡æ£ã¨ãããæç« ã®è©±ãªãã ã¨æããã ãã©ãä»åã¯è¤æ°ã§ç®¡çã¨ãããããã¨ããã¯ãããã«ç´ç²ã«ä¸äººã§æç« æ¸ãã¨ãã Git 使ãã¨ä¾¿å©ã ãã£ã¦ãã¨ãæ¸ããããªãã¨æãã ** æåã®ä¸æ© æç« ã管çãããã£ã¬ã¯ããªã Git 管çä¸ã«ç½®ã ->|| +>|sh| $ git init Initialized empty Git repository in /Users/yoshiori/tmp/nishio/.git/ ||< -** ã§ãç·¨éãã¦ã¨ãããã add +** ã§ãç·¨éãã¦ã¨ãããã add ãã¦ã³ããã +>|sh| +$ emacs nishio.txt +//ç·¨éãã +$ git add nishio.txt +git add nishio.txt +$ git commit -m 'æç« æ¸ãå§ã' + æç« æ¸ãå§ã + 1 files changed, 18 insertions(+), 0 deletions(-) + create mode 100644 nishio.txt +||< + +ããã§ç®¡çä¸ã«ç½®ãããã®ã§å¥½ãã«æ¸ãã¦ãã + +** æç« æ¸ãã¦ãéä¸ã§ç¹å®ã®æè¨ãç½®ãæããããªã£ãããç½®ãæãã Stage this hunk [y,n,q,a,d,/,s,e,?]? s
ä»åã¯ã³ã¬ã ã¨ã§ããããã®ã§ s ãæ¼ã㦠split ãã
Split into 5 hunks. @@ -1,6 +1,6 @@ * æ®éã®æç« ã Git ã§ç®¡çããã¨æ¥½ã ãã£ã¦è©± -id:nishiohirokazu ã奥ããã« Git ã使ããããããã +西尾ããã奥ããã« Git ã使ããããããã // ãã¨ã§ link ãªã®ã§ã¡ãã£ã¨ãã¼ã¸ã§ã³ç®¡çã¨ãã¦ã ãã§ã Git 使ãã¨æ¥½ã ãªãã¨æãã¨ãããæ¸ãã¦ã¿ããã Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? y
y ãæ¼ãã¦ããã¯åæ
@@ -4,8 +4,8 @@ // ãã¨ã§ link ãªã®ã§ã¡ãã£ã¨ãã¼ã¸ã§ã³ç®¡çã¨ãã¦ã ãã§ã Git 使ãã¨æ¥½ã ãªãã¨æãã¨ãããæ¸ãã¦ã¿ããã -ããid:nishiohirokazu ã¯å¤åè¤æ°ã§æ ¡æ£ã¨ãããæç« ã®è©±ãªãã ã¨æããã ãã©ãä»åã¯è¤æ°ã§ç®¡çã¨ãããããã¨ããã¯ãããã«ç´ç²ã«ä¸äººã§æç« æ¸ãã¨ãã Git 使ãã¨ä¾¿å©ã ãã£ã¦ãã¨ãæ¸ããããªãã¨æãã +ãã西尾ããã¯å¤åè¤æ°ã§æ ¡æ£ã¨ãããæç« ã®è©±ãªãã ã¨æããã ãã©ãä»åã¯è¤æ°ã§ç®¡çã¨ãããããã¨ããã¯ãããã«ç´ç²ã«ä¸äººã§æç« æ¸ãã¨ãã Git 使ãã¨ä¾¿å©ã ãã£ã¦ãã¨ãæ¸ããããªãã¨æãã ** æåã®ä¸æ© æç« ã管çãããã£ã¬ã¯ããªã Git 管çä¸ã«ç½®ã Stage this hunk [y,n,q,a,d,/,K,j,J,g,e,?]? y
ããã y ãæ¼ãã¦åæ
@@ -8,9 +8,9 @@ ** æåã®ä¸æ© æç« ã管çãããã£ã¬ã¯ããªã Git 管çä¸ã«ç½®ã ->|| +>|sh| $ git init Initialized empty Git repository in /Users/yoshiori/tmp/nishio/.git/ ||< Stage this hunk [y,n,q,a,d,/,K,j,J,g,e,?]? n @@ -13,6 +13,6 @@ $ git init Initialized empty Git repository in /Users/yoshiori/tmp/nishio/.git/ ||< -** ã§ãç·¨éãã¦ã¨ãããã add +** ã§ãç·¨éãã¦ã¨ãããã add ãã¦ã³ããã Stage this hunk [y,n,q,a,d,/,K,j,J,g,e,?]? n @@ -18 +18,15 @@ +>|sh| +$ emacs nishio.txt +//ç·¨éãã +$ git add nishio.txt +git add nishio.txt +$ git commit -m 'æç« æ¸ãå§ã' + æç« æ¸ãå§ã + 1 files changed, 18 insertions(+), 0 deletions(-) + create mode 100644 nishio.txt +||< + +ããã§ç®¡çä¸ã«ç½®ãããã®ã§å¥½ãã«æ¸ãã¦ãã + +** æç« æ¸ãã¦ãéä¸ã§ç¹å®ã®æè¨ãç½®ãæããããªã£ãããç½®ãæãã Stage this hunk [y,n,q,a,d,/,K,g,e,?]? n
æ®ããä¸å¿ç¢ºèªãã¦å«ããå¿ è¦ãç¡ãã®ã§ n ãæ¼ãã
ããã§ç¹å®ã®æè¨ãç½®ãæããã®ã ãã¨ããããã³ããããããã¨ãã§ãã
$ git commit -m 'id è¨æ³ãããã' [master 4e9ccab] id è¨æ³ãããã 1 files changed, 2 insertions(+), 2 deletions(-)
ãªããæç« ã®ä¸ã«ã diff ãæ¸ãå§ãããããããããªããªã£ã¦ããï½ï½ï½
ã®ã§ãããã§çµäºï½ï½ï½ï½
ä»åº¦æ©ä¼ããã£ãããã£ã¨ã¾ã¨ãã¦æ¸ã
$ git commit -m 'ããããããªã£ã¦ããã®ã§ã¾ãä»åº¦' [master 7982c61] ããããããªã£ã¦ããã®ã§ã¾ãä»åº¦ 1 files changed, 147 insertions(+), 2 deletions(-)
$ git diff diff --git a/nishio.txt b/nishio.txt index e5c2a60..7902037 100644 --- a/nishio.txt +++ b/nishio.txt @@ -161,3 +161,10 @@ $ git commit -m 'id è¨æ³ãããã' ãªããæç« ã®ä¸ã«ã diff ãæ¸ãå§ãããããããããªããªã£ã¦ããï½ï½ï½ ã®ã§ãããã§çµäºï½ï½ï½ï½ ä»åº¦æ©ä¼ããã£ãããã£ã¨ã¾ã¨ãã¦æ¸ã + +>|sh| +$ git commit -m 'ããããããªã£ã¦ããã®ã§ã¾ãä»åº¦' +[master 7982c61] ããããããªã£ã¦ããã®ã§ã¾ãä»åº¦ + 1 files changed, 147 insertions(+), 2 deletions(-) +||< +