GIThubに関して知っておくべきこと

以下を知っていればgitに関しては大体のことができる。

  1. addでアップする準備して、Pushで実際にアップする。
  2. コメントを書くことが出来る
  3. ログを見ることができる
  4. originを設定する
  5. コメントを書くことが出来る
  6. ファイルをアップする
  7. ファイルを消す
  8. Git Cloneの方法




ファイルをアップする準備が出来る。 $ git add run.py

txt形式のものを全てアップすることが出来る。 $ git add *.txt

got statusでコミットする準備段階のファイルを見ることが出来る。

$ git status

$ git remote add origin https://github.com/username/flask_basic.git

$ git push -u origin master
error: src refspec master does not match any.

コメントを書くことが出来る

$ git commit -m "first commit" 

ログを見ることができる

$ git log

originを設定する

$ git remote add origin https://github.com/user/flask_basic.git

ファイルをアップする

$ git push -u origin master
Username for 'https://github.com': UserID
Password for 'name':  Password
Compressing objects: 100% (33/33), done.

ここからはpart2 Remove 方法

git rm “sample 2.txt”
git commit -m “removed”
git push

Git Cloneの方法

$ cd gitclone
$ git init
Initialized empty Git repository in /Users/gitclone/.git/

$ git clone https://github.com/user/flask_basic.git
Cloning into 'flask_basic'...
remote: Counting objects: 53, done.
remote: Compressing objects: 100% (32/32), done.
remote: Total 53 (delta 4), reused 52 (delta 3), pack-reused 0
Unpacking objects: 100% (53/53), done.