さくらレンタルサーバーでのgit管理

バージョン管理したいフォルダに移動

% git init
% git status
$ git add .  (全てのファイルをインデックスへ追加)
$ git commit -m "2016/12/11 commit"  (コメントは任意)

リモートリポジトリの作成

% mkdir git
% cd git
% ls
% mkdir remote.git
% git init --bare

リモートリポジトリへpush

% git remote add origin ssh://hoge@siriuz.sakura.ne.jp/home/hoge/git/remote.git
% git remote -v
origin  ssh://hoge@siriuz.sakura.ne.jp/home/hoge/git/remote.git (fetch)
origin  ssh://hoge@siriuz.sakura.ne.jp/home/hoge/git/remote.git (push)
% git push origin master:master

ログ

% git log

git diff

% git diff

commit logの閲覧終了:q
git checkout

hidden file you can find
ls -a

git diff
git diff –staged
git diff commit1 commit2

git branch
-git branch
-git branch easy-mode

[vagrant@localhost reflections]$ git branch
* master
[vagrant@localhost reflections]$ git branch easy-mode
[vagrant@localhost reflections]$ git branch
  easy-mode
* master

checkout

[vagrant@localhost reflections]$ git checkout easy-mode
Switched to branch 'easy-mode'
[vagrant@localhost reflections]$ git branch
* easy-mode
  master

git log –graph –oneline

git merge

[vagrant@localhost reflections]$ git merge master easy-mode
Updating d878411..bdd001b
Fast-forward
 asteroids/game.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

remote branchへのpush
git push origin master