git_2
git_2
推送已有项目代码到远程仓库。
1.初始化仓库
1 | //初始化 |
现在使用git push origin master push到远程仓库上,会报如下错误,显示你并没有指定对应的远程仓库。
1 | fatal: 'origin' does not appear to be a git repository |
2.GitHub上创建项目并在本地提交项目
在github(gitee/gitlab)上创建新项目,并且拿到对应的空项目的https(http)/ssh路径。
例如我创建了git@github.com:loyalvi/hexo.git这个项目。git remote add origin git@gitlab.geovdo.com:zhengzhongyi/br-event-admin.git
1 | git remote add origin git@github.com:loyalvi/hexo.git |
成功提交(在此之前可能要输入账号密码)
1 | Enumerating objects: 119, done. |
!Pasted image 20221119133828.png