The Pragmatic Ball boy

iOSを中心にやってる万年球拾いの老害エンジニアメモ

Git基本操作

基本コマンド

git init

git add

git add .

git add -u リポジトリに登録されているファイルで変更されたものをインデックスに追加

git add -A ツリーの変更(削除、追加)

git add i 対話的にインデックスに追加

git diff --cached

git commit

git commit --amend 直前のコミットを削除してコミット


git diff

git show

git push

git pull

公開用リポジトリの作成


sudo mkdir /var/repo
cd /var/repo
git clone --bare repository_path ./name.git
git-daemon --export-all --enable=receive-pack --base-path=/var/repo
cd /var/repo
mkdir repository_name
cd repository_name
git --bare init
[1844] fatal: The remote end hung up unexpectedly
が出たらフォルダのパーミッションの問題
chmod 777 repository_name
git remote add test2 git://remote_repository_address/test2.git
git push git://remote_repository_address/test2.git