やりたいこと
VSCodeから一度他のアカウントにpushした後に他のアカウントに再度pushする必要が出てきた
わからないこと
ターミナル上でgitのユーザネームやメールアドレスを変更してadd, commit, pushを行ったが新しいアカウントにpushできない
試したこと
gitのユーザネーム, メールアドレスを変更した.
git config --global user.name 'username'
git config --global user.email 'xxx@users.noreply.github.com'
一度作成されたリポジトリを削除したrm -rf .git
originを削除したgit remote rm origin
以下のコマンドを実行した
git init git add . git commit -m "first commit" git branch -M main git remote add origin https://github.com/ユーザ名/レポジトリ名.git git push -u origin main
エラーコード
fatal: unable to access 'https://github.com/ユーザ名/レポジトリ名.git/': The requested URL returned error: 403

回答2件
あなたの回答
tips
プレビュー