[[Linuxの備忘録]] [[ここ:http://taichino.com/memo/1587]]を参考にさせてもらった gitユーザとグループ作成 [git@server]$ adduser git [git@server]$ usermod -G git taichino # 自分 [git@server]$ usermod -G git dev1 # 他の開発者 [git@server]$ su - git [git@server]$ vim ~/.bashrc # umaskを002に設定する # リモートリポジトリ作成 [git@server]$ mkdir -p /home/git/hoge.git # リモートリポジトリ名には.gitを付ける [git@server]$ cd /home/git/hoge.git [git@server]$ git --bare init # ローカルリポジトリ作成とリモートリポジトリへの登録(by ishida) [ishida@local]$ mkdir hoge [ishida@local]$ cd hoge [ishida@local]$ git init [ishida@local]$ echo "Hello git project" > readme [ishida@local]$ git add readme [ishida@local]$ git commit -m "start project with git" [ishida@local]$ git server add origin ssh://ishida@server/home/git/hoge.git [ishida@local]$ git push origin master # cloneとpush (by dev1) [dev1@local]$ git clone ssh://dev1@server/home/git/hoge.git [dev1@local]$ cd hoge [dev1@local]$ vim readme # 適当に編集 [dev1@local]$ git add readme [dev1@local]$ git commit -m 'modified for pull test' [dev1@local]$ git push origin master * commit [#pb610a91] ローカルでの修正を登録する [ishida@local]$ git commit -m "hogehoge modified" * push (by ishida) [#t201ed7e] ローカルでの作業をサーバーに反映させる [dev1@local]$ git push origin master * clone [#k3a71115] git clone ssh://gusers@150.59.**.**/home/gusers/Git/Research.git * pull [#u107f593] サーバーから現在のレポジトリをローカルへ反映させる git pull