简体   繁体   English

Git 分支未显示所有分支

[英]Git branch is not displaying all branches

I'm new to using Git, I cloned a branch from GitHub and all branches are displayed when I typed git branch .我刚开始使用 Git,我从 GitHub 克隆了一个分支,当我输入git branch时,所有分支都会显示。 After finishing my work, I pushed it to a new branch successfully.完成我的工作后,我将它成功地推到了一个新的分支。 After that, I copied the folder to another directory (because I wanted to have a backup to avoid conflicts), entered it, and typed git branch .之后,我将文件夹复制到另一个目录(因为我想有一个备份以避免冲突),进入它,然后输入git branch Only 3 branches displayed, knowing that I have 4 on Github.只显示了3个分支,知道我在Github上有4个。

I tried to solve the issue by cloning the branch inside a new folder (typed git clone -b <branch-name> <repo-link-https> ) and now only the branch that I cloned is appearing..我试图通过将分支克隆到一个新文件夹(键入git clone -b <branch-name> <repo-link-https> )来解决这个问题,现在只有我克隆的分支出现了。

Any suggestions please?有什么建议吗?

When you clone an existing repository, your Git makes a new and different repository, and copies into this new repository all 1 of the commits and none of the branches from the original repository.当您克隆一个现有的存储库时,您的 Git 会创建一个新的不同的存储库,并将所有1个提交复制到这个新存储库中,而不会复制原始存储库中的任何分支 The last step of git clone is to create one branch. git clone最后一步是创建一个分支。 This branch name is yours , not theirs;这个分支名称是的,不是他们的; it's just spelled the same as one of their names.它只是拼写与他们的名字之一相同

As you work with your clone—a different repository—you can add more and more branches to it.当您使用您的克隆(一个不同的存储库)时,您可以向它添加越来越多的分支。 If you add to it all the same branches that are in the original repository, you now have all of their commits and all of their branch names (as your own branches, mind you).如果您将原始存储库中的所有相同分支添加到它,您现在拥有它们的所有提交它们的所有分支名称(请注意,作为您自己的分支)。 But until then, you just have all of their commits .但在那之前,你只有他们所有的提交 That's fine, because Git isn't about branches.没关系,因为 Git 与分支无关。 Git is about commits . Git 是关于提交的。


1 The precise description is much more complicated than this, but thinking of it as "copy all of their commits and none of their branches" will get you started. 1精确的描述比这复杂得多,但将其视为“复制他们的所有提交,不复制他们的分支”会让您入门。


I tried to solve the issue by cloning the branch inside a new folder (typed git clone -b ) and now only the branch that I cloned is appearing..我试图通过将分支克隆到一个新文件夹(键入git clone -b )来解决这个问题,现在只有我克隆的分支出现了。

When you make a new clone—which, again, is a new repository, where you get all of the previous repository's commits but none of its branches yet—the last step of the git clone command is to run a git checkout or git switch command 2 that makes one branch.当你创建一个新的克隆时——同样,它是一个的存储库,你可以在其中获得以前存储库的所有提交,但还没有它的分支git clone命令的最后一步是运行git checkoutgit switch命令2构成一个分支。 The -b flag exists so that you can tell your Git which of their branch names to copy, as the last step. -b标志存在,因此您可以告诉您的 Git 要复制分支名称,作为最后一步。 If you omit the -b flag, your Git asks their Git repository—the one you're cloning—which branch they recommend.如果您省略-b标志,您的 Git 会询问他们的 Git 存储库(您正在克隆的存储库)他们推荐哪个分支。 But either way you get only one branch.但无论哪种方式,你都只能得到一个分支。

You don't actually need any branch names to do work in Git. You do need some kind of name, though, and branch names are the best kind of name here.实际上,您不需要任何分支名称即可在 Git 中工作。不过,您确实需要某种名称,分支名称是此处最好的名称。 That's why your Git makes one name at the end of the git clone process.这就是为什么您的 Git 在git clone过程结束时成为一个名字的原因。 Each name you make gives you one more thing to work with.你起的每一个名字都会让你多做一件事情。

To understand what's going on, read on.要了解发生了什么,请继续阅读。 If you're satisfied that your immediate question has been answered, you can stop here.如果您对您的直接问题已得到回答感到满意,您可以到此为止。


2 The git switch command was first added in Git version 2.23, to split up the overly-complicated git checkout command into two separate commands, git switch and git restore . 2 git switch命令是在 Git 2.23 版本中首次添加的,将过于复杂的git checkout命令拆分为两个单独的命令, git switchgit restore The existing git checkout remains;现有的git checkout依然存在; you can use it instead of the two new, simpler commands.您可以使用它来代替这两个新的、更简单的命令。 The new simplified commands are in a sense safer, though: the git switch command tries to be very safe, as does the half of git checkout that it copied.不过,新的简化命令在某种意义上更安全: git switch命令试图非常安全,它复制的git checkout的一半也是如此。 The git restore command, however, is deliberately unsafe in that it will irrevocably destroy work;然而, git restore命令是故意不安全的,因为它会不可撤销地破坏工作; it copies the other half of git checkout .它复制了git checkout的另一半。 So if you use git checkout , you can accidentally invoke the "destroy my work" half when you think you're invoking the "safely do stuff" half.因此,如果您使用git checkout ,当您认为您正在调用“安全地做事”的一半时,您可能会意外地调用“销毁我的工作”的一半。


Git is all about commits Git 是关于提交的

To understand what Git is doing here and why it does this like this, start with the fact that Git itself is really all about commits.要了解 Git 在这里做什么以及为什么这样做,首先要了解 Git 本身就是关于提交的事实。 It's not about branches, though branch names help you (and Git) find commits.这与分支无关,尽管分支名称可以帮助您(和 Git)找到提交。 It's not about files, though commits contain files.它与文件无关,尽管提交包含文件。 It's really about the commits: everything else Git does is in service of retaining and adding commits.这实际上与提交有关:Git 所做的其他所有事情都是为了保留和添加提交。 The commits are where things start, and are the purpose of everything else.提交是事情的开始,也是其他一切的目的。

This means it's crucial to understand what a commit is , how you name a particular commit , and how you make a new commit.这意味着了解什么是提交、如何命名特定提交以及如何进行提交至关重要的。 Let's start with the name.让我们从名字开始吧。

The true name of a commit is its hash ID提交的真实名称是它的 hash ID

You might think that a branch name would name a commit—and it sort of does, but indirectly.您可能认为分支名称会命名一个提交——它有点命名,但间接地命名。 In fact, every commit is named by its number.事实上,每个提交都以其编号命名。 Each commit has a unique number.每个提交都有一个唯一的编号。 No other commit can ever have that number: once that commit is made, that number is allocated to that commit.没有其他提交可以拥有该编号:一旦提交,该编号就会分配给提交。 Because that commit takes up that number forever, the number has to be really big, and it is.因为那个提交永远占据了那个数字,所以这个数字必须非常大,而且确实如此。 Currently, each Git commit gets one out of 2 160 possible numbers.目前,每个Git提交都会获得 2160 个可能数字中的一个。 3 This number gets expressed in hexadecimal as a big ugly string like e31aba42fb12bdeb0f850829e008e1e3f43af500 (this is an actual commit in a Git repository for Git itself). 3这个数字以十六进制表示为一个丑陋的大字符串,例如e31aba42fb12bdeb0f850829e008e1e3f43af500 (这是 Git 存储库中 Git 本身的实际提交)。

This number always works: if you have this commit, that is its number, and git show e31aba42fb12bdeb0f850829e008e1e3f43af500 will show it, for instance.这个数字总是有效的:如果你有这个提交,那就是它的数字, git show e31aba42fb12bdeb0f850829e008e1e3f43af500会显示它。 You can usually abbreviate the number, to as little as the first four characters if that's unambiguous, so if you have a clone of the Git repository for Git, git show e31aba42fb12bdeb0f850829e008 is almost guaranteed to work.如果没有歧义,您通常可以将数字缩写为前四个字符,因此如果您有 Git 存储库的 Git 的克隆, git show e31aba42fb12bdeb0f850829e008几乎可以保证工作。 But git show e31a doesn't because it could be short for this commit, or for commit e31a17f741... , for instance.但是git show e31a不是因为它可能是此提交的缩写,或者是提交e31a17f741...的缩写。 While e31ab works today, as more commits get added, it might stop working.虽然e31ab今天可以工作,但随着更多提交的添加,它可能会停止工作。

These numbers look random, but aren't.这些数字看起来是随机的,但事实并非如此。 In fact, each one is a cryptographic checksum of the complete contents of the commit.事实上,每一个都是提交的完整内容的加密校验和。 4 Git does a double-check when extracting any of its internal objects, including commits, that the checksum still matches, so as to detect storage failures: you tell Git to find a commit (or other object) by hash ID and it checks that the hash ID still matches. 4 Git 在提取其任何内部对象(包括提交)时进行双重检查,校验和仍然匹配,以检测存储故障:您告诉 Git 通过 hash ID 查找提交(或其他对象),它检查hash ID 仍然匹配。 So this in turn means that no part of any commit—or any of Git's other internal objects—can ever change , either.所以这反过来意味着任何提交的任何部分——或任何 Git 的其他内部对象——都不能改变 You can make new ones, each of which gets a new and different ID, but this does not affect the existing ones, which remain in the repository.你可以创建的,每个都有一个新的和不同的 ID,但这不会影响现有的,它们保留在存储库中。


3 There are plans to redo the numbering system to use 2 256 numbers, with some kind of ugly transition. 3计划重做编号系统以使用 2 256个号码,并进行某种丑陋的过渡。

4 In fact, all of Git's internal objects use this scheme. 4事实上,所有Git 的内部对象都使用这种方案。 This means all saved objects are frozen for all time.这意味着所有保存的对象都被永久冻结。 This is how Git freezes and de-duplicates file contents, for instance.例如,这就是 Git 冻结和删除重复文件内容的方式。


What's in a commit什么是提交

Now that we know one—and the deepest, as it were—way to look up a commit, by its hash ID, it's time to look at what's inside each commit.既然我们知道了一种——可以说是最深入的——查找提交的方法,即通过其 hash ID,是时候查看每个提交中的内容了。 Each commit has two parts:每个提交有两个部分:

  • A commit holds a full snapshot of all your files.提交包含所有文件的完整快照 This is the main data of most commits (and usually also the bulk of the repository).这是大多数提交的主要数据(通常也是存储库的大部分)。 Each file is stored as an internal blob object , using this same hash-name-encoding trick.每个文件都存储为内部blob object ,使用相同的哈希名称编码技巧。 This automatically de-duplicates files, so that if you make a hundred commits in a row that mostly re-use most of their files, they don't really take any extra space.这会自动删除重复文件,因此如果您连续提交一百次并且大部分都重复使用了他们的大部分文件,它们实际上不会占用任何额外空间。

  • Each commit also holds some metadata , or information about the commit itself: who made it, when, and why, for instance.每个提交还包含一些元数据,或有关提交本身的信息:例如,谁提交的、何时提交的以及为什么提交。 The "why" part is your log message: your own explanation to yourself and/or others later. “为什么”部分是您的日志消息:您稍后对自己和/或其他人的解释。 Why is this commit better than the last one?为什么这个提交比上一个更好? Or at least, why it is any different, if it's not necessarily better.或者至少,如果它不一定更好,为什么它会有所不同。 The goal of this particular commit might be to fix some bug, or add some new feature, or make something ready to add a new feature, or whatever.这个特定提交的目标可能是修复一些错误,或者添加一些新功能,或者为添加新功能做准备,等等。 The commit itself has the updated source code, but not necessarily anything about the bug that the update is supposed to fix.提交本身有更新的源代码,但不一定是关于更新应该修复的错误的任何内容。 This is your chance to explain that.这是你解释的机会。

There's a piece of the metadata that Git generates for you, and then uses later, that you rarely see directly, and that is this: Each commit holds the raw hash ID of its immediate predecessor commit. Git 为您生成并稍后使用的元数据中有一段您很少直接看到,那就是:每个提交都包含其前一个提交的原始 hash ID。 This strings commits together, backwards , into a chain of commits that ends with the latest commit.这个字符串一起提交,向后,进入以最新提交结束的提交链。

We can draw this.我们可以画这个。 Imagine we have a repository with just three commits in it.想象一下,我们有一个只有三个提交的存储库。 Instead of real hash IDs, we'll use single uppercase letters to stand in for the commits.我们将使用单个大写字母代表提交,而不是真正的 hash ID。 The very first commit will be A , the next will be B , and the third commit is commit C :第一个提交是A ,下一个是B ,第三个提交是C

A <-B <-C

Since commit C is the last one, it has earlier commit B 's hash ID in its metadata.由于提交C是最后一个,因此它的元数据中有较早提交B的 hash ID。 We say that C points to B .我们说C指向B By the same token, commit B points to A .出于同样的原因,提交B指向A Since A is the very first commit ever made, it lacks this backwards-pointing arrow: it does not point anywhere.由于A是有史以来第一个提交,因此它缺少这个向后指向的箭头:它不指向任何地方。 Git calls this a (or the) root commit . Git 将此称为(或)根提交 It's where we get to stop working backwards.这是我们停止向后工作的地方。

I mentioned just a moment ago that each commit has a full snapshot of every file.我刚才提到,每次提交都有每个文件的完整快照。 But if you have Git show a commit, Git shows you what changed .但是,如果您有 Git显示提交,则 Git 会显示更改内容。 How and why does Git do this? Git 如何以及为什么这样做?

The why is perhaps the easiest to explain.为什么可能是最容易解释的。 If you want to see all the files that are in the commit, you can just check out the commit.如果你想查看提交的所有文件,你可以只检查提交。 Git will copy all those files out of the commit—where, remember, they're stored in a special frozen Git format, de-duplicated (and compressed too)—to regular ordinary computer files. Git 会将所有这些文件从提交中复制出来——记住,它们以特殊的冻结 Git 格式存储,去重(并压缩)——到普通的普通计算机文件。 You probably have a bunch of file viewers that are more competent than Git could ever be: they can show you images as images, open textual documents in text editors, open PDFs with PDF viewers, and so on.你可能有一堆比 Git 更能干的文件查看器:它们可以将图像显示图像,在文本编辑器中打开文本文档,用 PDF 查看器打开 PDF,等等。 But your file-viewer probably can't compare the entire snapshot with the previous entire snapshot.但是您的文件查看器可能无法将整个快照与之前的整个快照进行比较。 Git can . Git可以

Git can compare snapshot C against snapshot B pretty easily, because commit C holds commit B 's hash ID. Git 可以很容易地将快照C与快照B进行比较,因为提交C持有提交B的 hash ID。 So Git can just extract both commits.所以 Git 可以提取两个提交。 Moreover, because of the way Git de-duplicates files, Git can immediately know—and not even bother extracting—the duplicated files.此外,由于 Git 删除重复文件的方式,Git 可以立即知道——甚至不必费心提取——重复的文件。 Git needs only to extract and compare the different files. Git 只需要提取并比较不同的文件。 Git will do that, and will construct a set of changes that will turn the old files into the new ones. Git 将执行此操作,并将构造一组更改,将旧文件转换为新文件。 That's what Git will show you: this set of instructions.这就是 Git 将向您展示的内容:这套说明。

(Note that Git creates the set of instructions on demand. Until you ask Git to compare any two commits, all Git has are the two snapshots. You can get different sets of instructions based on options you pass to the comparison command. For instance, Git can do the difference-checking based on words, or otherwise ignore certain kinds of white-space changes. Git's abilities here are not always as good as we might like, but there are some tricks we can use. They're out of scope for this particular answer, though.) (请注意,Git 按需创建指令集。在您要求 Git 比较任意两个提交之前,所有 Git 都有两个快照。您可以根据传递给比较命令的选项获得不同的指令集。例如, Git 可以根据单词进行差异检查,或者忽略某些类型的空白变化。Git 在这方面的能力并不总是像我们想象的那么好,但是我们可以使用一些技巧。它们出自 scope不过,对于这个特定的答案。)

Finding commits by branch names按分支名称查找提交

We already know that if we memorize the big ugly hash IDs (or write them down), we can use those to find commits.我们已经知道,如果我们记住丑陋的 hash ID(或写下来),我们可以使用它们来查找提交。 But this is ridiculous.但这是荒谬的。 We have a computer .我们有一台电脑 Why don't we have the computer write down the hash IDs for us?为什么我们不让计算机为我们记下 hash ID?

This is what a branch name does.这就是分支名称的作用。 But it's a little sneaky.但这有点偷偷摸摸。 What a branch name really does is store just the last commit's hash ID.分支名称真正做的是仅存储最后一次提交的 hash ID。 Let's draw that three-commit repository again, and add a name, main , that identifies the last commit:让我们再次绘制那个三提交存储库,并添加一个名称main来标识最后一次提交:

A--B--C   <-- main

Here, instead of trying to remember C 's hash ID, we just know that the name main does that for us.在这里,我们不需要记住C的 hash ID,我们只知道名称main为我们做了这些。 So git checkout main (pre-2.23 Git) or git switch main (2.23 and later) gets us the latest commit—currently C —no matter what hash ID it has.因此git checkout main (Git 2.23 之前的版本)或git switch main (2.23 及更高版本)为我们提供了最新的提交——当前C无论它具有什么 hash ID。

We can now add a new name that also points to commit C :我们现在可以添加一个新名称,该名称也指向提交C

A--B--C   <-- main, dev

Now we need one more thing: which of these names are we using?现在我们还需要一件事:我们正在使用这些名称中的哪些? Right now, it doesn't matter much, because both names select commit C .现在,这并不重要,因为两个名称 select 都提交C But let's attach the special name HEAD to one of the two branch names, like this:但是让我们将特殊名称HEAD附加到两个分支名称之一,如下所示:

A--B--C   <-- main (HEAD), dev

If we git switch dev , we're re-attaching the special name HEAD to the name dev , like this:如果我们git switch dev ,我们会将特殊名称HEAD重新附加到名称dev ,如下所示:

A--B--C   <-- main, dev (HEAD)

Now let's make a new commit.现在让我们做一个的提交。 Without worrying about how we make a new commit, let's just assume that it's all done.不用担心我们如何进行新的提交,让我们假设一切都已完成。 This new commit D will, necessarily, point back to existing commit C , because we made D from C .这个新的提交D必然会指向现有的提交C ,因为我们C制作了D So that looks like this:所以看起来像这样:

A--B--C
       \
        D

But D is now the latest commit, so Git has to update a name .但是D现在是最新的提交,所以 Git 必须更新一个name Which name should it update?它应该更新哪个名称? The answer is clear: it should update the one that HEAD is attached-to:答案很明确:它应该更新HEAD附加到的那个:

A--B--C   <-- main
       \
        D   <-- dev (HEAD)

We now have two branch names, and the two names specify two different "latest" commits.我们现在有两个分支名称,这两个名称指定了两个不同的“最新”提交。 The latest commit on main is C , and the latest commit on dev is D . main上的最新提交是Cdev上的最新提交是D Commit D points back to commit C , which points back to B , which points back to A ;提交D指向提交C ,后者指向B ,后者又指向A so all four commits are on branch dev , while three of them are on main .所以所有四个提交都分支dev上,而其中三个在main上。

If we switch back to the name main and make new a new commit there, we get:如果我们切换回名称main并在那里进行新的提交,我们会得到:

        E   <-- main (HEAD)
       /
A--B--C
       \
        D   <-- dev

which means we now have three commits that are shared on both branches, and one commit that is only on main and one commit that is only on dev .这意味着我们现在有三个提交在两个分支上共享,一个提交只在main上,一个提交只在dev上。 Now we need both names to find all five commits;现在我们需要两个名字来找到所有五个提交; one name will find one commit, which will find the three shared commits, but we need the other name to find the last remaining commit.一个名字会找到一个提交,这会找到三个共享的提交,但是我们需要另一个名字来找到最后一个剩余的提交。

Note that the branch names move .请注意,分支名称会移动 In fact, they move automatically, as we make new commits: whichever branch name has HEAD attached to it automatically moves to encompass the new commit.事实上,当我们进行新提交时,它们会自动移动:附加了HEAD的分支名称会自动移动以包含新提交。 All the other branch names stay in place at that point, but because they are our branch names, we are in control.所有其他分支名称此时都保持不变,但因为它们是我们的分支名称,所以我们处于控制之中。 We can have our Git move those names any time we like.我们可以让我们的 Git 随时移动这些名称。 The only constraint is that we have to have a commit to move the name to.唯一的限制是我们必须提交才能将名称移动到。

Cloning creates remote-tracking names克隆创建远程跟踪名称

When we clone someone else's repository, we get all their commits and none of their branches.当我们克隆其他人的存储库时,我们得到了他们所有的提交,但没有得到他们的任何分支。 How does this work?这是如何运作的? Well, suppose we have the above, with two actual branch names main and dev selecting commits E and D respectively.好吧,假设我们有上面的内容,有两个实际的分支名称maindev分别选择提交ED We now make a new repository where we copy all five commits, giving us:我们现在创建一个的存储库,我们复制所有五个提交,给我们:

        E
       /
A--B--C
       \
        D

We do actually need two names to find all the commits.我们确实需要两个名称来查找所有提交。 But we don't need branch names.但是我们不需要分支名称。 The other Git, working with the other repository, has branch names, because those are his branches that he'll move around as he makes new commits.另一个 Git 与另一个存储库一起工作,具有分支名称,因为这些是在进行新提交时将移动的分支。 So what our Git does is copy their names but change them .所以我们的 Git 所做的就是复制他们的名字改变他们 We have our Git take their branch names and create our remote-tracking names , by adding something—usually origin/ —to the names.我们让我们的 Git 获取他们的分支名称并创建我们的远程跟踪名称,方法是在名称中添加一些东西——通常是origin/ 5 So we get: 5所以我们得到:

        E   <-- origin/main
       /
A--B--C
       \
        D   <-- origin/dev

Git will refuse to attach the special name HEAD to one of these remote-tracking names. Git 将拒绝将特殊名称HEAD附加到这些远程跟踪名称之一。 HEAD is only allowed to attach to a branch name. HEAD只允许附加到分支名称。 So the last step of our git clone is to use the -b option, or their recommendation, to pick one of these two names, and create a branch name from it, like this:所以我们git clone的最后一步是使用-b选项,或者他们的建议,选择这两个名称之一,并从中创建一个分支名称,如下所示:

        E   <-- main (HEAD), origin/main
       /
A--B--C
       \
        D   <-- origin/dev

Note that our branch name selects the same commit as the remote-tracking name that our git clone made from their branch name.请注意,我们的分支名称选择与我们的git clone从其分支名称生成的远程跟踪名称相同的提交 But we now have only one branch name, not two.但是我们现在只有一个分支名称,而不是两个。 If we run:如果我们运行:

git switch dev

this uses a special feature that Git provides, that finds their origin/dev and creates our own new name dev :这使用了 Git 提供的一个特殊功能,找到它们的origin/dev并创建我们自己的新名称dev

        E   <-- main, origin/main
       /
A--B--C
       \
        D   <-- dev (HEAD), origin/dev

and now we have two branch names.现在我们有两个分支名称。 But we didn't initially.但我们最初没有。 Note that we also now have commit D checked out, rather than commit E , because git switch (or git checkout , if we use that) not only switches branches, but also selects the commit that the branch name identifies, as the commit that is to be checked-out, and therefore available to us to work with.请注意,我们现在还检查了提交D ,而不是提交E ,因为git switch (或git checkout ,如果我们使用它)不仅切换分支,而且还选择分支名称标识的提交,作为提交待签出,因此可供我们使用。


5 Technically, a remote-tracking name is in a separate namespace . 5从技术上讲,远程跟踪名称位于单独的名称空间中。 Our Git doesn't just tack origin/ in front, it replaces refs/heads/ with refs/remotes/origin/ .我们的 Git 不仅将origin/放在前面,还将refs/heads/替换为refs/remotes/origin/ The name origin is actually a remote and we can have as many remotes as we like in our Git repository.名称origin实际上是一个遥控器,我们可以在 Git 存储库中拥有任意数量的遥控器。 But this is a topic for another question.但这是另一个问题的主题。

In order to make sure you have all the up to date information on branches from Github (your remote), you can do a git fetch :为了确保您拥有 Github(您的遥控器)分支机构的所有最新信息,您可以执行git fetch

git fetch --all

Where the --all flag fetches branches from all remotes. --all标志从所有遥控器获取分支的位置。 If you would just like to see all the branches (on your machine and on your GitHub), you can do a git branch :如果你只想查看所有分支(在你的机器和你的 GitHub 上),你可以做一个git branch

git branch -av

Where -a shows branches from local and remotes, and -v gives more verbose output.其中-a显示来自本地和远程的分支, -v给出更详细的 output。

Notes:笔记:

For branches, use git branch -avv to get a list of all local and remote branches.对于分支机构,使用git branch -avv获取所有本地和远程分支机构的列表。
Then try again your copy, and compare git branch -avv when done in the new copied folder: if a remote branch is missing, a simple git fetch will be enough.然后再次尝试您的副本,并在新复制的文件夹中完成时比较git branch -avv :如果缺少远程分支,则简单的git fetch就足够了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM