How to upload local files to Gitee

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

Insert picture description here

2. Create the folder to be uploaded

Herein by F:\数据结构way of exampleInsert picture description here

3. Configure the target warehouse address (the warehouse address to be uploaded)

Copy the address of the target warehouse first:

Insert picture description here

The F:\数据结构right to open a command window directoryInsert picture description here

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:Insert picture description here

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:Insert picture description here

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

Guess you like

Origin blog.csdn.net/weixin_44829930/article/details/111635154