Manage these remote repositories so thatPushOrPullData
- Add remote database
- Remove obsolete remote database
- Manage various remote database branches
- Define whether to track branches
View the current remote database
You can use the GIT Remote Command to list the short names of each remote database.
You can also add the-V option to display the corresponding clone address:
If there are multiple remote repositories, this command is all listed. For example, in my grit project, you can see:
Add remote Repository
To add a new remote repository, you can specify a simple name for future reference and run git remote add [shortname] [url].
Capture data from a remote warehouse
$ Git fetch [Remote-name]
Remember that the FETCH command only pulls the remote data to the local warehouse and does not automatically merge the data to the current work branch. You can only merge the data manually when it is ready.
If you have set a branch to track the branch of a remote repository (see the following section and chapter 3), you can use the GIT pull command to automatically capture data, then, the remote branch is automatically merged to the current branch in the local repository. In our daily work, we often use this method fast and well.
Push data to remote warehouse
Git push [Remote-name] [branch-name].
If you want to push the local master branch to the origin server (again, the clone operation will automatically use the default master and origin names), run the following command:
$ Git push origin master
This command will complete the task on schedule only when the cloned server has the write permission or no one else is pushing data at the same time. If you have already pushed several updates before pushing data, your push operation will be rejected. You must capture their updates locally and merge them into your project before pushing them again.
View remote Repository Information
Use commandsGit remote show [Remote-name]View Details of a remote warehouse
Delete and rename a remote Repository
UseGit remote renameCommand to modify the local abbreviation of a remote Repository
For example, if you want to change PB to Paul, you can run it like this:
$ Git remote rename Pb Paul
Git remote RM command: delete/remove a remote repository.
Chrysanthemum: supports mass blog tools on various major blog websites!