LoginSignup
0
0

More than 3 years have passed since last update.

開発準備 git

Posted at

GitHub 接続

commit して push するまで

  1. GitHub 登録
  2. SSH 公開鍵 作成
  3. GitHub 公開鍵 登録
  4. gitリポジトリ 登録
  5. .gitconfig 設定
  6. git 初期化
  7. (merge &) commit & push

1. GitHub 登録

いわずもがな、省略。

2. SSH 公開鍵 作成

https://qiita.com/shizuma/items/2b2f873a0034839e47ce を参考に作業
(引用)

$cd ~/.ssh
$ssh-keygen -t rsa

問いかけられるけど3回Enterを押してスルーすると鍵を生成完了

3. GitHubに公開鍵を登録

接続確認!

$ ssh -T git@github.com
Hi YKHSJP! You've successfully authenticated, but GitHub does not provide shell access.

OK!

4. gitリポジトリ 登録

リポジトリのディレクトリに移動して

$ git remote set-url origin git@github.com:YKHSJP/study.git

と登録(:YKHSJP/study.git は自身の値)

config を確認する

$ git config remote.origin.url
git@github.com:YKHSJP/study.git // OK

5. .gitconfig 設定

cd ~/

.gitconfig

[user]
    name = {last name} {family name}
    email = {email}

6. git 初期化

ディレクトリに移動して

$ git init
Initialized empty Git repository in C:{path}.git

7. (merge &) commit & push

とても詰まった所。
push ができない問題。
解決してくれたのはやはり他Qiitaページでした。本当感謝。
https://qiita.com/takanatsu/items/fc89de9bd11148da1438

$ git merge --allow-unrelated-histories origin/master
Not committing merge; use 'git commit' to complete the merge.
$ git commit -m "first commit"
[master c16f5ca] first commit
$ git push origin master

やっと push 完了!😿

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