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?

More than 3 years have passed since last update.

[Git] ローカル→リモートにプッシュとちょっとした修正まで

Last updated at Posted at 2020-04-25

###グローバル設定 (gitコマンドでデフォルトで使うリポジトリの設定)

.giconfig
[user]
    name = "My Name"
    email = myname@example.com

ローカル設定

ユーザ名省略

https:// ここに[ユーザ名@]github.com/
※ @も忘れずに!

.git/config
[remote "origin"]
	url = https://[ユーザ名@]github.com/[ユーザ名]/dotfiles.git

コマンド

ローカルにリポジトリ作成、リモートにプッシュ

git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/XXXX/XXXXXX.git
git push -u origin master

その他

こちらを参考
https://qiita.com/kohga/items/dccf135b0af395f69144

git status                 # ローカルの変更を確認
git diff                   # リモートとローカルの差分を確認
git log                    # commitの変更履歴を見る
git show [commit id]       # 指定したcommitの変更を見る
git push origin [branch]   # リモートにプッシュ
git reset HEAD [ファイル名]  # addの取り消し
git reset --head HEAD^     # commitの取り消し
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?