@Fumichan Fumichan authored on 15 Jul 2019
Seminar_camp 日程変更 4 years ago
haruto-kun Move terakotta program to subdirectory 4 years ago
.gitignore Add .gitignore to avoid handling trash files 4 years ago
Hello.rb said Hello 4 years ago
README.md changed README.md(Minor change) 4 years ago
a.rb add a.rb 4 years ago
a1.rb add a1.rb 4 years ago
aaa.txt コメント追加しました 4 years ago
c117231-kimuchi.odt add file 4 years ago
chanfumi.txt chanfumi.txt add commment ああああああああ 4 years ago
janken.rb Put space between puts/print and bare string 4 years ago
madddoka.txt madoka.txt change madddoka.txt 4 years ago
madoka.txt I wrote a question madoka.txt 4 years ago
match.rb bysasaki 4 years ago
popup.html add in popup.html 4 years ago
rinkou1.html add in rinkou1.html 4 years ago
rinkou2.html add in rinkou2.html 4 years ago
style.css add in style.css 4 years ago
suyasuya.txt said Nemutann 4 years ago
test.txt add test.txt 4 years ago
README.md

Gitの使い方

Gitでバージョン管理をする前に

Gitの環境設定

  • Gitの環境設定をする (初回のみ)

      git config --global user.name "your name"
      git config --global user.email "c11xxxx@x.koeki-u.ac.jp"
      git config --global push.default simple (どうやらver.2.1からデフォルトらしい)
  • Gitの環境設定値を確認する

      git config --list

リポジトリを新規に作成する場合・既に存在するリポジトリを初期化する場合

  • リポジトリを作成したいディレクトリでgit initする (初回or初期化時)
      git init

既に存在しているリモートリポジトリをコピーしてローカルリポジトリを作成する場合

  • ターミナル上でリポジトリ(git_practice_2019)のクローンを作る (初回のみ)
      git clone https://www.yatex.org/gitbucket/HiroseLabo./git_practice_2019.git

普段の作業の流れ

  1. クローンした作業ディレクトリに移動する

     cd git_practice_2019
  2. リポジトリからの更新をpullする

     git pull
  3. 編集作業をする(emacs・vi等)

  4. 新規作成したものをaddする (新規ファイル作成時の1度のみ)

     git add ファイル名
  5. commit messageを追加してcommitする

     git commit -m "更新内容"
  6. 4と5を繰り返していき、最終的にローカルリポジトリの更新をリモートリポジトリにpushする

     git push

備考

  • pushする時にエラーが出る場合がある。サーバの方に何かが更新されているとpushできないため、pullしてからmergeする。
     git pull
     git merge