Premise:
When you create a branch from the new branch, your code is a new branch of branch and the source code to maintain consistent, if you pull the code down the new branch will create local branches of the same name of the warehouse, and to establish a link, also call trace relationships, then you are in the local development Specific can consult this article understanding of vscode use
Cause:
In company development, you need to pull a new branch to develop, and when you finish development, if you pull a branch that conflicts with the original branch (that is, before you merge their code into the source branch, but you also merge the new branch into the source branch), it will be a conflict to bring up Mr. Git fetch,git merge,git pull
Git fetch: The git fetch command is used to remotely track updates to a branch (git terminology is called a commit) and to fetch those updates locally.
For git fetch a specific usage, the link above have links in your article, so here only speak common methods < br > update all branches, commands can be abbreviated to: git fetch command to a remote host on the updated information, retrieve all local. By default, git fetch fetches updates for all branches. Git fetch < remote host name > < branch name > If you want to fetch updates from a particular branch, you can specify the branch name as follows: git fetch < remote host name > < branch name > git fetch origin masterCopy the code
2. The git merge command is used to merge two or more development histories.
Git merge dev merges the dev branch into the current branch to make new commits automatically: git merge dev merges the dev branch with the current branchCopy the code
3. The git pull command retrieves the update of a branch on the remote host and merges it with the specified branch on the local host
Git pull < remote host name > < remote branch name >:< local branch name > for example, to fetch the next branch of origin and merge it with the local branch of Master, Git pull origin next:master Git pull origin next:master git pull origin next:masterCopy the code
- Git fetch is a remote repository code update. Git fetch is a remote repository code update. Git merge is a remote repository code update update
Now let’s solve this problem
-
Merge Request: Merge request,dev request,dev request,dev request,dev request,dev request,dev request,dev request Then you choose to modify the conflicting content of the master (to the desired content) and commit, which means that the master branch is committed one step ahead of the dev branch, which means that the merge is complete.
-
Actually, the command from above doesn’t have much to do with the question, so why am I saying it? Because I want to talk about another problem familiar with this, that is, when you are in local development, when you want to push your code to the remote repository, you will find that the remote code is submitted by others, at this time you should git pull to update your code
Finally, post a link to the article that inspired me www.yiibai.com/git/git_rem…