Git のバックアップ差分(No.3) - アールメカブ

アールメカブ


Git のバックアップ差分(No.3)


  • 追加された行はこの色です。
  • 削除された行はこの色です。
[[Linuxの備忘録]]

[[ここ:http://taichino.com/memo/1587]]を参考にさせてもらった

gitユーザとグループ作成
#contents

* ユーザー情報 [#ue8e6ed4]

 git config --global user.name "Your Name"
 git config --global user.email you@example.com

If the identity used for this commit is wrong, you can fix it with:

 git commit --amend --author='Your Name <you@example.com>'



*gitユーザとグループ作成 [#z0da528e]

 [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に設定する
 
# リモートリポジトリ作成
* リモートリポジトリ作成 [#udb5a7e1]
 [git@server]$ mkdir -p /home/git/hoge.git
  # リモートリポジトリ名には.gitを付ける
 [git@server]$ cd /home/git/hoge.git
 [git@server]$ git --bare init
 
# ローカルリポジトリ作成とリモートリポジトリへの登録(by ishida)
* ローカルリポジトリ作成とリモートリポジトリへの登録(by ishida) [#e4f6b571]
 [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)
* cloneとpush (by dev1) [#w813d37e]
 [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