Add Existing Project to git repository

Scenario: do a project, we need to put git warehouse

 Why do this record?

Our general operation is the first warehouse, then git clone to an empty folder. Then the empty folder Riga project file. Then git push

Now is the first project, after git. Git clone if directly into an existing directory will direct error, because the folder is not empty.

 

 

Solution one:

First git clone repository address to an empty folder, and then copy the .git directory to your project directory and then delete the temporary folder

 

Solution two:

cd project

git init 

git remote add origin https://gitlab.home.xxxxxxx.com/gongxxxxshou/gjgsios.git

git pull origin master

 

Guess you like

Origin www.cnblogs.com/dzqdzq/p/11268104.html