Repository operate on the git and github

Simple illustrating the principles of Git

Source: https://www.cnblogs.com/ljhdo/p/4811096.html

 

Basic Operations

A can to a local repository through git clone

Second, their new repository process:

  1. Local new folder, the folder corresponds to a repository on github

mkdir git-repository
cd git-repository

  

  2. In the local New file that can be uploaded via the git add command files related to the workspace

vim test.txt # new document, written by vim completed, after the adoption of: wq to exit and save 
. git add # implication here is to upload all new files in the current directory to the workspace, another use: git add <filename >

  

  3. Create a new repository on github

 

  4. establish contacts database on your local library and github

git remote add origin <url> # http add on github repository of url 
git Remote -v # view the status of 

git status # View the status and history git submitted 
git commit -m "comment" # submit this revision and add a comment 

git pull origin master --allow-unrelated- histories # github will drop down to the local remote repository, this step because on the local and the establishment of two independent github repository, you need to Merge 

git the Push Origin Master # local upload to github repository remote repository

  

reference:

Git basic operations:  https://www.cnblogs.com/ljhdo/p/4811096.html

Git error process: https://blog.csdn.net/u012145252/article/details/80628451

Guess you like

Origin www.cnblogs.com/dachangStudio/p/12310187.html