Source: http://blog.tsnrose.com/2012-04-18-git-fetch.html (Thanks to the author for sharing)Sometimes we need to get other people's code repositories, to merge others (not push to the remote repository), to incorporate their own modifications, or to look at the code under a branch of someone else (without actually switching to someone else's branch), this article
If you want to fetch a branch on GitHub to the local machine, directly enter the following command:
Git checkout origin/
Result error:
Error: pathspec 'origin/feature_renrendai_tongji 'did not match any file (s) known to git.
See http://stackoverflow.com/questions/5989592/
There are 2 commands in git that get the latest version from the remote branch to the Local:
git fetch: The equivalent of getting the latest version from remote to local, not automatically merge
Git fetch origin master
Typically, when merging branches, GIT uses patterns when possible, Fast forward but in this mode, the branch information is discarded after the branch is deleted.If you want to force the mode to be disabled, Fast forward git will generate a new commit at merge, so you can see the branching information from the
names it locally as origin/master. Git will also give you a local master branch that points to the same place as the master branch of origin, so you have the basis for the job.
Remote Repository The name "origin", like the branch name "master", does not have any special meaning in
Git branch management and Git branch managementGit branch management overview
Almost every version control system supports branches in some form. Using a branch means you can separate it from the Development Main Line and continue
Tag: File mat sed repos. NET git diff stat file objectsSee what branch are currently available[emailprotected] xmrobotium$ git branch* masterCreate a new branch xm2.x[emailprotected] xmrobotium$ git
Git branch learning note and git branch note
Introduction
After two times of Git content, I forgot the concept of branch in the next day and thought it was not very useful. Then I read it again to find out why it is an extremely i
The basic principles of git are described in the previous two-disk article, which is theoretical knowledge. In this article we go back to practice and look at the use of Git branching (branch).In the Code versioning tool, there is a branch concept. When we started building the repository, we had only one main
Branch (branches) refers to the development of the main line of separation, do further development without affecting the original main line.Git does not store a series of change sets (changeset), but rather a series of snapshots. When you perform a commit, Git stores a Commit object that contains a pointer to a snapshot of what you currently need to commit.The function of the master
Use the git branch-a command to view all local and remote branches (git branch-r can view only remote branches)Found that many of the branches that have been deleted in the remote repository are still visible locally.
$ git branch
the modified files need to be submitted before switching branches
1. Switch branches
Git checkout-b branchname to create a branch locally and switch to that branch
V. Merging of branches
1. Merge the Branch (Branchname) in development into the main branch (Otherbranchname)
1. Create local branch Local_branch
Git branch Local_branch
2. Create local branch Local_branch and switch to Local_branch branch
Git checkout-b local_branch
3. Switch to Branch Local
Git operations-branch management (2), git operation branch managementResolve Conflicts
Scenario: Create a new branch feature1 and then add it to the readme.txt file.4 create a branch named feature1And then submit it on the feature
. Then Git builds a local branch of your own, starting with the master origin master same location on the branch where you can start working (see Figure 3-22):
Figure 3-22.Once a git clone builds your own local branch master and Remote
You can update the remote repository's code locally using git fetch and git pull, but there is a difference between them. Today search git pull and fetch, found that the amount of information is very large, involved in git a lot o
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.