1、下载githttps://git-scm.com/download/win
,并安装
2、建立一个本地文件夹,存放需要上传的文件
3、桌面右键->更多选项->Open Git bash
4、cd /e/yourfilefloder
进入文件夹
5、执行git init
,生成.git文件
5、git add .
将整个文件夹加入本地缓存,git add test.txt
把指定文件加入缓存
6、git commit -m
“注释”,如果首次运行会提示:
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email you@example.com
按照提示执行语句就行
git config --global user.name "你的名字"
git config --global user.email "你的邮箱"
7、
git remote add origin 你的gitlab上的远程地址
若提示fatal: remote origin already exists.
因为已经配置过远程仓库,
使用git remote set-url origin
更改配置
使用git remote -v
查看远程仓库情况
8、
推送代码到远程仓库
git push -u origin master
linux系统,则更改前三部操作即可
参考文章:
https://blog.csdn.net/GUOER007/article/details/131949910