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
2 . Local resources are also initialized a git repository
git init
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
then on the success
we have to create a test file at:
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
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 test
Use git clone [email protected]: /home/mycode/test.git successfully clone a remote repository