Many times we have created a project locally, and we want to use Git to upload the code to prevent accidental loss of code after the project has gone through a phase. At this point we need to know how to upload a local project to a remote Git repository.
Most of our daily life is to pull items from a remote git repository to local, and then upload them when the changes are complete. This process is believed to be familiar to everyone, so I wrote this blog specifically to provide beginners with a way to upload local items to a remote git repository.
Here are the specific steps:
1. Establish a repository in the remote repository
2. Executing in a local project: GIT init initialization project
3. Associate the local warehouse with the Remote warehouse: (Here the local project name is called User-interface-test)
git remote add origin [email protected]:xin.shen/user-interface-test.git
Note: Replace the warehouse address with your own warehouse address
4. Submit the Local code:
1 git add-A2" commit code "
5. Push the local project to the remote repository:
Git push-u Origin Master
Upload a local repository to a remote git repository