Github两个不同的帐户-处理身份验证

时间:2019-10-17 15:44:01

标签: git github github-pages

我有两个不同的github帐户,一个是个人帐户,另一个是我公司的帐户。

我在全局设置的工作帐户中使用SSH密钥,在本地为特定存储库设置的个人帐户中使用用户名和密码。

我对将任何一个帐户中的更改进行推送和推送都没有问题。它的工作原理很完美。

  

但是,当我尝试将代码部署到github页时,它会从我的个人帐户尝试使用错误的用户名(工作帐户)进行身份验证

以下是错误。

Gaurang033 -个人帐户

gaurang_work -工作帐户

▶ rm -rf node_modules/gh-pages/.cache; npm run deploy

> most-popular@0.1.0 predeploy /Users/gaurang.shah/gitRepo/popular-movies
> npm run build


> most-popular@0.1.0 build /Users/gaurang.shah/gitRepo/popular-movies
> react-scripts build

Creating an optimized production build...
Compiled successfully.

File sizes after gzip:

  56.16 KB  build/static/js/2.8360eafd.chunk.js
  1.94 KB   build/static/js/main.867a2b42.chunk.js
  785 B     build/static/js/runtime~main.d936f90a.js
  397 B     build/static/css/main.6f7911ff.chunk.css

The project was built assuming it is hosted at /Gaurang033/popular-movies/.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.

Find out more about deployment here:


> most-popular@0.1.0 deploy /Users/gaurang.shah/gitRepo/popular-movies
> gh-pages -d build

remote: Permission to Gaurang033/popular-movies.git denied to gaurang_work.
fatal: unable to access 'https://github.com/Gaurang033/popular-movies.git/': The requested URL returned error: 403

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! most-popular@0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the most-popular@0.1.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/gaurang.shah/.npm/_logs/2019-10-17T15_41_17_131Z-debug.log

我无法使用单独的SSH Config,因为HostName的{​​{1}}都是相同的

0 个答案:

没有答案