新規ファイルを作成して追加

概要

リポジトリディレクトリに新規ファイルを追加して、コミットします。


手順

リポジトリディレクトリへ移動

hoge@WKPC-MSHIGE1979 /d/demos
$ cd d:
 
hoge@WKPC-MSHIGE1979 /d
$ cd demos
 
hoge@WKPC-MSHIGE1979 /d/demos
$ cd git_repo/
 
hoge@WKPC-MSHIGE1979 /d/demos/git_repo (master)
$ pwd
/d/demos/git_repo
 
matsumoto@WKPC-MSHIGE1979 /d/demos/git_repo (master)
$
 

ファイルを作成します


「git add ファイル名」を実行

hoge@WKPC-MSHIGE1979 /d/demos/git_repo (master)
$ git add testdata.txt
 
hoge@WKPC-MSHIGE1979 /d/demos/git_repo (master)
$
 

「git commit -m "コメント"」を実行

hoge@WKPC-MSHIGE1979 /d/demos/git_repo (master)
$ git commit -m "test commit"
[master 8742fb8] test commit
 1 file changed, 4 insertions(+)
 create mode 100644 testdata.txt
 
hoge@WKPC-MSHIGE1979 /d/demos/git_repo (master)
$
 
 
※1つのファイルをリポジトリへ保存
  • m "文字列"でコメントを登録する


最終更新:2012年10月27日 06:42