How to upload local files to your own Gitee

Table of contents

1. For the gitee warehouse project that has been created, upload files to the warehouse

2. For existing warehouses, and after uploading files one or more times, you need to update the code to gitee

3. Clone the project from gitee to the local


1. For the gitee warehouse project that has been created, upload files to the warehouse

Go to the project directory that needs to be uploaded, right click and selectGit Bash Here

# 第一步:初始化项目,然后会生成.git文件夹
git init
# 第二步:将当前目录加入到git(.代表全部)
git add .   
# 第三步:git提交到本地版仓库,并注明提交的缘由
git commit -m "first commit(提交的描述信息也就是提交的说明)"
# 第四步:git本地库链接远程版本库,这一步会有对应的账号密码操作(配置过SSH公钥的就没有)
# xxxx 代表你所上传的git仓库地址
git remote add origin xxxx

The fourth step example is as follows:

$ git remote add origin https://gitee.com/guo-ruiwb/layui-file-reference.git
# 第五步:将文件上传到gitee中的master分支,-u代表第一次上传
git push -u origin master

Note: Generally, in a complete project, only the .git folder will be generated in the first-level directory. If there is a .git folder in the uploaded second-level directory folder, only the second-level directory folder will be uploaded, and the content under the second-level directory folder will not be uploaded. If there is no .

2. For existing warehouses, and after uploading files one or more times, you need to update the code to gitee

Go to the project directory that needs to be uploaded, right click and selectGit Bash Here

# 第一步:列出自己做出修改的文件,会列出你修改的文件以及新增的文件
git status
# 第二步:将当前目录加入到git, .代表全部更新, 指定文件更新则点替换为指定文件名
git add .
git add test.txt
# 第三步: 添加更新说明
git commit -m "更新说明"
# 第四步: 执行更新操作
git push origin master

3. Clone the project from gitee to the local

Go to the project directory that needs to be uploaded, right click and selectGit Bash Here\

# xxx 代表g项目的克隆地址,仅需一步
git clone xxx
git clone https://gitee.com/guo-ruiwb/layui-file-reference.git

Guess you like

Origin blog.csdn.net/growb/article/details/130216679