Linux下向GitHub 上传代码
1.先在Github个人主页创建一个仓库 2.在根目录下,复制仓库链接,将仓库复制到本地
git clone https://gitclone.com/github.com/<GithubName><RepositoryName>.git
3.进入本地仓库目录
git init
4.输入以下代码,下载之前学习的脑图
wget https://labfile.oss.aliyuncs.com/courses/1330/linux.png
wget https://labfile.oss.aliyuncs.com/courses/1330/python1.png
wget https://labfile.oss.aliyuncs.com/courses/1330/python2.png
wget https://labfile.oss.aliyuncs.com/courses/1330/git.png
5.添加仓库内的所有文件
git add --all
6.配置
git config --global user.name "YourName"
git config --global user.email "YourEmail@xxx.com"
7.提交
git commit -m "first commit"
8.连接GitHub
git remote set-url origin https://<your_token>@github.com/<USERNAME>/
<REPO>.git
9.推送
git push origin master
检验测试:
|