Git repository link local cloud code remote repository

Original link: point I

When git commits, is empty, there is a local source

 

Open cmd should return to the path of the project

Then enter git push -u origin master -f

The local project is forced to push an empty warehouse

 

 

 

git init (initialize a git repository in the current folder)

git add. (to store all files in the current work area to the staging area)

git commit -m "commit" (if not, then ignore this, plus this)

git remote add origin https://xxxxxxxxxxxxxxxxx

git push -u origin master (if not to enter the top)

The local project has been uploaded to the remote repository

1, a new remote repository

 

 
 

Then fill in the project-related information on demand

 

 
 
 
 

Click Create

 

 
 

Click cloning / downloaded Address

 
 

2, create a local warehouse

Under the project directory, open git, initialize the local warehouse 

git init

 
 

3, the local warehouse and associated remote repository

 git remote add origin https://gitee.com/wangshiting/meituan.git

 
 

Here, the address is the address of the first step in a remote library

4, the local project push to a remote repository

Before push to pull, but because these are two different projects, direct pull will complain

refusing to merge unrelated histories

We need to write

git pull origin master --allow-unrelated-histories

 
 

Then push

git add .

git commit -m "2018"

git push -u origin master

-u only need to add the first time, the role of the local warehouse and associated remote repository up

 

 
 

 

 
 

 

 
Hey, something went wrong, and do it again

 

 
 

Successful, the code is coming to see the cloud

 

 

Open cmd should return to the path of the project

Then enter git push -u origin master -f

The local project is forced to push an empty warehouse

 

 

 

git init (initialize a git repository in the current folder)

git add. (to store all files in the current work area to the staging area)

git commit -m "commit" (if not, then ignore this, plus this)

git remote add origin https://xxxxxxxxxxxxxxxxx

git push -u origin master (if not to enter the top)

Guess you like

Origin www.cnblogs.com/myfate/p/12133939.html