0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ローカルのプロジェクトを新規に GitHub に上げるコマンド

0
Posted at

ローカルで開発中のコードを GitHub に連携する動作はエンジニアなら基本動作・・・かもしれないが、新規にプロジェクト作るのは毎回それないりに久しぶりで毎回コマンドをAIに聞いているので、このあたりでメモっておく

ローカルファイルを Git で管理するためのコマンド

管理したいプロジェクトの親フォルダで以下を実行

git init
git add .
git commit -m "コミットコメント"

GitHub との連携

git branch -M main
git remote add origin https://レポジトリURL.git
git push -u origin main

add origin コマンドでURLを間違えた場合

add origin の時点ではエラーは吐かれず、pushした時点でそんなレポジトリはないと怒られる。
以下のコマンドで修正。

git remote set-url origin https://正しいレポジトリURL.git
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?