0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Githubコマンド入門コマンド(備忘録)

Last updated at Posted at 2023-02-01

皆さんGithub使ってますか?
先日久しぶりにGithubを使用しようとしたところ、コマンドを一部忘れてしまっていた為、また忘れたとき用に備忘録を作りたいと思います。

Gitをインストールします
$ sudo apt-get install git
Gitの初期設定
$ git config --global user.name "Your Name"
$ git config --global user.email "youremail@example.com"
ローカルリポジトリの作成
$ mkdir myproject
$ cd myproject
$ git init
リモートリポジトリを追加
$ git remote add origin https://github.com/username/myproject.git
ファイルの追加

ここではREADME.mdをサンプルとして使用します。

$ echo "Hello World" > README.md
$ git add README.md
コミット
$ git commit -m "Initial commit"
プッシュ
$ git push -u origin master
GitHubリポジトリのクローン
$ git clone https://github.com/username/myproject.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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?