LoginSignup
0
1

More than 3 years have passed since last update.

【Git】リポジトリ作成

Last updated at Posted at 2021-03-15

リポジトリ作成

リポジトリ作成するときの毎回の儀式
忘れるのでメモする

流れ

対象ディレクトリに移動

cd vue-tasks/

git初期化

git init

状態確認

git status

差分ステージングに追加

git add .

コミットする

git commit -m "initial commit"

github上でリモートリポジトリを作成する

リモートリポジトリのアドレスを名前を付けて記録(これをすることでリモートリポジトリへの操作をするときいちいちURLを叩かなくて済む)

  • origin:記録する名前

  • https://github.com/tanoken729/vue-tasks.git(例)

リモートリポジトリのURL

git remote add origin https://github.com/tanoken729/vue-tasks.git(例)

リモートリポジトリに変更履歴をpushする
実行オプションで-uを指定すると、次回以降はそのブランチ名の指定を省略できる(一番初めはorigin masteを省略できない)

git push -u origin master

リモートリポジトリをgithubで作成したときのREADME.mdがある(githubで作成したときにREADME.md作成した場合)とpushが失敗する

対処法
https://qiita.com/kazuki0714/items/ceda3a6721a9a99082de
もう一個あったはず。

参照

サル先生のGit入門【新しいリポジトリを作成する】

0
1
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
1