git remote set-url [--push] <name> <newurl> [<oldurl>]
git remote Set-url--add [--push] <name> <newurl>
git remote Set-url--delete [--push] <name> <url>
For example: Git remote set-URL origin git@GitHub. COM:user/repo. git
Git is recently ready to move to a location where the command line is used to do the following.
1.git init initializes the Git repository, and this time found a more. Git folder in the local folder.
2.git remote Add-url origin add repository address
3. Git remote Set-url origin associated repository address
The main point here is to hook up the local library with the remote repository.
Use a graph to represent:
4. Next, there are two scenarios, that is, whether Git location 2 is an empty address.
A) If it is an empty address, OK is simple.
First git Add.
Then git commit-m '
With this command: git push, if not so you can use the strong push git push-f
Of course, this is pushing the current project to the Remote Default branch (master)
Extension: If you want to push all the branches that are local including master, you can use the following methods:
(1) Git push--all-f (theory possible)
(2) Insurance Use the following command: (must be possible)
Git Checkout branch Name
Git push origin test (local branch): Test (remote branch)
If it is not good, be sure to overwrite the words, you can add a-f
Git push-f origin test (local branch): Test (remote branch)
b) If it is not an empty address, OK is also very simple, first clear the address, and then push.
This is how I use the empty method here.
First, create a folder locally, and then use:
git clone address
Hook the local to the remote library, and then use the Purge command.
Git rm.
or git rm-r file name (delete folder)
Then push it so that the remote repository is emptied. And then execute a)
GIT engineering Migration (Modify submit server address) method