0
0

More than 1 year has passed since last update.

Gitの基本操作

Posted at

ローカルにリポジトリを作成する 

⑴「git init」がリポジトリを作成する
⑵「git add」がファイルをインデックスに追加する(Gitに管理する対象のfileをアップする)
⑶「git commit」でインデックスした内容を変更する
  git commit -m "ここにコメントを記載できます!"

$ git init
$ git add .
$ git commit -m "Initial commit"

リモートにプッシュする

→超簡単に言えばアップデートしましょうねという話
⑴「git remote add origin "URL"」で新しいリモートの設定
⑵「git push origin master」ローカルのコードをoriginというリモートリポジトリに送る

$ git remote add origin https://github.com/XXXX/XXXXXX.git
$ git push  origin master

アップデートした内容を取り消す

インデックスされた特定のfileの変更を取り消す

$ git reset .
$ git reset HEAD .

$ git reset <File_Name>
$ git reset HEAD <File_Name>

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0