How to upload local files to Gitee
Overall process
In general, there are several steps as follows:
- Create a warehouse (if you already have one, don't create it)
- Create the folder to be uploaded
- Configure the remote warehouse address (the warehouse address to be uploaded)
- Synchronize with warehouse files
- Put the file to be uploaded into this folder and add it to the file buffer
- Submit to local
- Push to Gitee
1. Create a warehouse (if you already have one, you don't need to create it) and initialize a readme file
2. Create the folder to be uploaded
Herein by F:\数据结构
way of example
3. Configure the target warehouse address (the warehouse address to be uploaded)
Copy the address of the target warehouse first:
The F:\数据结构
right to open a command window directory
Enter the following command to configure the warehouse address:
git remote add origin https://... /仓库名.git //后面改为你自己刚复制的仓库地址
4. Synchronize with the files in the warehouse
Enter the following command to synchronize the current directory with the warehouse:
result:
Administrator@WIN-7OBJ8081STU MINGW64 /f/数据结构 (master)
$ git pull origin master
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From https://... /仓库名
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master
5. Put the file to be uploaded into this folder and then add it to the file buffer
First put the files you want to upload into this folder:
Then enter the following command
git add . //添加当前目录下的所有文件到
6. Submit the file to the local first
Enter the following command to submit the file to the local:
git commit -m '数据结构代码' //单引号内的内容为提交时的备注信息
It will eventually appear next to the folder:
7. Push to the Gitee warehouse
Enter the following command to push the local file to the warehouse:
git push origin master //master是默认分支名,这里可以根据自己需要进行修改
result:
Counting objects: 94, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (78/78), done.
Writing objects: 100% (94/94), 26.45 KiB | 1.76 MiB/s, done.
Total 94 (delta 26), reused 0 (delta 0)
remote: Powered by GITEE.COM [GNK-5.0]
To https://gitee.com/he_fu_ren/data-structure-code.git
115fa52..8a424a2 master -> master