1, (first enter the project folder) by this command git init git directory can be turned into a warehouse management
git init
2, to add files to the repository, use the command git add. Add to the staging area to go inside, do not forget after the decimal point ".", Meaning all files add folder
git add .
3, use the command git commit tell Git, the submission of documents to the repository. Quotes to commit
git commit -m 'first commit'
4. Related to the remote library
git remote add origin of your remote repository address
such as:
git remote add origin https://github.com/githubusername/demo.git
5, access to remote and local synchronization library merge (if the remote library does not have to do this step is empty, otherwise the back of the submission will fail)
git pull --rebase origin master
6, the contents of the local repository pushed to the remote, use the git push command, in fact, the current push to the remote master branch. After executing this command you will be asked to enter a user name, password, after verification by start uploading.
git push -u origin master
* Status query command
git status
View remote git repository address command
git remote -v
If you want to modify a remote repository Address:
$ git remote set-url origin [email protected]:mkl34367803/WebAjax.git
Then push:
$ git push origin master
Preparation: Refer http://www.cnblogs.com/tugenhua0707/p/4050072.html
https://www.cnblogs.com/eedc/p/6168430.html