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?

参照仕様をリモートにプッシュできません。最初に pull を実行して変更を統合してください。の予想外の直し方

Posted at

エラーが出た経緯

VSCodeを使い始めて数ヶ月して、GitHubと連携することになったので、ネットで見つけたサイトを参考にしてメールアドレスとユーザー名の設定を...
あれ?設定用のメールアドレスってどこだ?
Email settings.png
(github.com/settings/emailsの下の方にある設定)
お!この設定を有効にしたら設定用のメールアドレスが出てきたぞ!
これで登録できる!

エラーの内容

VSCodeでプログラムを書けたから、GitHubにコミットして同期しよ
参照仕様をリモートにプッシュできません。最初に pull を実行して変更を統合してください。
?なんだ?とりあえず言う通りにするか→直らず
その後ネットで色々調べてきて
まずは強制的にpull→直らず
次にローカルリポジトリの再作成→直らず
最後に強制的push→直らず
その他諸々→直らず
もうだめだぁ おしまいだぁ

解決法

一応意味わからないと思うけどエラーの内容見るか

git-error.txt
> git push origin main:main
remote: error: GH007: Your push would publish a private email address.        
remote: You can make your email public or disable this protection by visiting:        
remote: https://github.com/settings/emails        
To https://github.com/[ユーザー名]/[リポジトリ名].git
 ! [remote rejected] main -> main (push declined due to email privacy restrictions)
error: failed to push some refs to 'https://github.com/[ユーザー名]/[リポジトリ名].git'

push declined due to email privacy restrictions
日本語にすると「電子メールによるプライバシー保護のため、プッシュはお断りします。」
メールアドレス?設定見るか
Email settings-1.png

これだ

この下の設定を切ったら何事もなかったかのように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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?