brief git push step
1. Git init
Create a new warehouse, create a new folder, open, and then execute
Git init 2. Create a local warehouse
Using the command "Git remote Add Origin git@github.com:yourname/yourrepo.git", Youname is your github username
Git remote add Origin git@github.com:yourname/yourrepo.git
s if the "fatal: Remote origin already exists" error is found, execute the following instructions before executing the instructions above
Git remote RM Origin 3. Add Files
For example, to add a file xxx to the local repository, use the command "git add xxx" and use "git Add." Automatically determine which files to add, add all modified or new files
git Add. 4. Submission of Changes
Git commit-m "code submission Information" 5. Push Changes
Now your changes are now in the head of the local warehouse. Execute the following command to submit the changes to the remote repository
Git push Origin Master
If the following error occurs
tip: The update was rejected because the remote repository contains a commit that does not yet exist locally. This is usually because the other
Tip: A warehouse has been pushed to the reference. You may need to consolidate the remote changes before pushing again
You can try two ways: 1 get a remote update and merge with the local, and then git push
Git remote add Origin https://github.com/username/Hello-World.git
gitfetchorigin//get remote update GIT fetch ORIGIN//Get remote update git merge origin/master//merge updated content to local branch 2) forcibly update via +master
Git push-u origin +master