How to submit local project code and synchronize it to the gitee repository

1. Create a new git repository

Insert image description here
This is what it looks like after creation!
Insert image description here

2. Submit to git repository

1) When the project has git information, it needs to be deleted first

Call the command line in the directory of the local warehouse to delete the .git folder in the root directory and enter

rm -rf .git
will clear the local repository. As shown below, the master is gone.

2) Manually delete the remaining .git files

Enter rm -rf + github warehouse address on the command line, for example

rm -rf https://github.com/xxx/xxx.git

3) Submit step, if you create a new project, omit 1) 2)

Open our project. There is no .git file in the project at this time.
In your project folder, [right-click the mouse] to pop up the menu.
In the menu that pops up [right-click the mouse], click [Git Bash Here]
in the command window. Enter: git init.
In the newly created warehouse in Gitee, copy the address of the warehouse.
In the command window, enter: git remote add origin. Enter your warehouse address.
In the command window, enter: git pull origin master.
In the command window, enter: git. add.
In the command window, enter: git commit -m "Submit project"
In the command window, enter: git push origin master
Now you can go to Gitee your warehouse, refresh it, and upload the local project to your own Git warehouse

4) An error occurred

An error occurred in the last step.
Insert image description here
Solution: When the code is submitted to the local warehouse, or as long as the code in the local warehouse is already up to date,
use: git push --force [email protected] to solve
Insert image description here

Guess you like

Origin blog.csdn.net/rainAndyou/article/details/127391078