头部分支的用途是什么

头部分支的用途是什么

本文介绍了起源/头部分支的用途是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,我们在git中看到两个分支:

  
$ b $ origin / master 是 master的位置分支在远程称为原点。

By default we see two branches in git:

origin/master
origin/HEAD

I wonder, what is head used for?

解决方案

HEAD is a a symbolic reference (similar to a symbolic link) that points to the branch you're on. You can get the reference it points to using git symbolic-ref HEAD. If you switch branches (e.g. git checkout branch1), HEAD will point to that. This is stored in a file in .git as .git/HEAD.

master is a local branch that you can work on. It's usually the default if you clone a repository or start a fresh one.

origin/master is the location of the master branch on the remote called origin.

这篇关于起源/头部分支的用途是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 12:59