首先要下载git,因为github使用git上传的,码云也是用git上传的
git下载地址:https://git-for-windows.github.io/
一路安装过去就行了。
但是!!如果你的系统不是正版的,安装成功后右键点击gitbash会闪退
解决方法 https://blog.csdn.net/lavendersue/article/details/81475706
然后你需要一个github账号,所有还没有的话先去注册吧!
https://github.com/
进入Github首页,点击New repository新建一个项目
Repository name: 仓库名称
Description(可选): 仓库描述介绍
Public, Private : 仓库权限(公开共享,私有或指定合作者)
Initialize this repository with a README: 添加一个README.md
gitignore: 不需要进行版本管理的仓库类型,对应生成文件.gitignore
license: 证书类型,对应生成文件LICENSE
这个截图是你创建成功后的截图,它会教你怎么上传,命令行都有给你
如果你有成功安装git
项目文件右键会有git bash 和git gui here 选项
这里我们选择Git Bash
设置git
输入
$ git config --global user.name "你的username" $ git config --global user.email "你的邮箱"
|
输入 $ git init
这样 D:/demo 就是我的repository(master)
输入
$ git add main 上传main到git main 是我要上传的项目 在D:/demo/main
|
输入 $ git commit -m "你要记录的信息"
解释一下git commit
命令,-m
后面输入的是本次提交的说明,可以输入任意内容,当然最好是有意义的,这样你就能从历史记录里方便地找到改动记录。
嫌麻烦不想输入-m "xxx"
行不行?是可以的,但是强烈不建议你这么干。
输入
$ git remote add origin https://github.com/DreamXDream/hwj.git origin后面的地址是你的github地址 |
最后输入
$ git push -u origin master 将项目push上去 输入你的github 账户和密码 完成上传
|