Local and remote upload git clone git repository to a local

Local and remote git creates a connection
local to a new git git items uploaded to a remote repository:
1 . Create a remote repository
created in init --bare test.git # remote execution and initializes a git git repository
Create and initialize a new git repository

2 . Local resources are also initialized a git repository
git init
Local resources are also initialized a git repository
then you will find inside the folder out of a .git folder, indicating the success of the local git repository created
3 . Association online repository
git remote add origin <online warehouse url>
online warehouse for the following url link
[email protected]: /wenhaofan/xxx.git # 127.0.0.1 you git repository can be replaced by the corresponding ip
The combined warehouse
then on the success
we have to create a test file at:
Test file
git upload the Add to add the file name # such as: git add test file .txt
or directly represent git add # add all uploaded files.
git the commit -m "zzza" # upload notes
git push origin master # uploaded to the master branch

Upload successful

After which we remember the key point:
after uploading git commit not only uploaded to the local repository, such as uploading to a remote repository need to process a push, and upload from the local warehouse to the remote repository:

Sometimes upload failed merger, that push is not successful, we need to first pull down a remote repository
to git pull and then push

Next we try to upload it down clone git repository file see if you can successfully:
New Create a folder testnew folder

Use git clone [email protected]: /home/mycode/test.git successfully clone a remote repositoryHere Insert Picture Description
Here Insert Picture Description

Released four original articles · won praise 1 · views 82

Guess you like

Origin blog.csdn.net/MyController/article/details/104730462