LoginSignup
0
0

More than 5 years have passed since last update.

vagrant上からgithubにプッシュしようとした

Last updated at Posted at 2017-02-05

vagrant上で以下の様にプッシュしようとしたら怒られました.

[vagrant@localhost docker]$ git push origin master
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/[USERNAME]/docker.git/info/refs

fatal: HTTP request failed
[vagrant@localhost docker]$

以下ではアカウント名がないので

https://github.com/[USERNAME]/docker.git/info/refs

https:://の後に [USERNAME]@を加えたものをgitのremoteにアカウントを追加しましょう.

$ git remote set-url origin https://[USERNAME]@github.com/[USERNAME]/rss.git

[vagrant@localhost docker]$ git push origin master
Password:
Counting objects: 16, done.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (15/15), 5.09 KiB, done.
Total 15 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), done.
To https://[USERNAME]@github.com/[USERNAME]/docker.git
   588effa..0df2e8f  master -> master
[vagrant@localhost docker]$

ちなみに変更結果は以下で確認できます.

[vagrant@localhost docker]$ vim .git/config

まぁ,それ以前に秘密鍵を設定しろよって話なんですけどね.

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