首页 > 编程知识 正文

git推送到远程非master仓库,git本地仓库推送远程

时间:2023-05-05 23:10:10 阅读:239739 作者:1876

1.Git关联远程仓库

       git关联远程仓库命令为:git remote add origin +https或git协议   

$ git remote add origin https://github.com/SimpleSimpleSimples/gitDemo.gitfatal: remote origin already exists.2.文件的修改与推送

       就修改Git默认创建的ReadMe.md文件然后用git push -u origin master把master所有文件推送源代码origin,此后就可以使用git push  origin master推送最新修改,推送过程可能需要输入用户名密码。

Administrator@DESKTOP-MJT2PP1 MINGW64 /e/GitDemo/gitDemo (master)$ git add README.mdAdministrator@DESKTOP-MJT2PP1 MINGW64 /e/GitDemo/gitDemo (master)$ git commit -m "关联远程仓库的修改"[master 00a24c2] 关联远程仓库的修改 1 file changed, 2 insertions(+), 1 deletion(-)Administrator@DESKTOP-MJT2PP1 MINGW64 /e/GitDemo/gitDemo (master)$ git push -u origin masterfatal: HttpRequestException encountered. ▒▒▒▒▒▒▒▒ʱ▒▒▒▒Username for 'https://github.com': SimpleSimpleSimplesCounting objects: 3, done.Writing objects: 100% (3/3), 309 bytes | 309.00 KiB/s, done.Total 3 (delta 0), reused 0 (delta 0)To https://github.com/SimpleSimpleSimples/gitDemo.git aa1f2e8..00a24c2 master -> masterBranch master set up to track remote branch master from origin.Administrator@DESKTOP-MJT2PP1 MINGW64 /e/GitDemo/gitDemo (master)

       推送成功后刷新结果可以看到


版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。