草庐IT

checkOut

全部标签

git - 无法 checkout 远程 git 分支

我在github本地克隆中。以下是分支机构列表:$gitbranch-a*masteronline-demoremotes/origin/HEAD->origin/masterremotes/origin/developremotes/origin/gh-pagesremotes/origin/masterremotes/origin/online-demoremotes/pateketrueke/developremotes/pateketrueke/gh-pagesremotes/pateketrueke/master当我尝试checkout远程分支时,出现错误:$gitcheck

git checkout-index : unable to create file (File name too long)

我检查了我的存储库,但有一个文件名太长:~/git$gitclonegit+ssh://server/git/ma.gitInitializedemptyGitrepositoryin~/git/ma/.git/remote:Countingobjects:1855,done.remote:Compressingobjects:100%(1594/1594),done.remote:Total1855(delta656),reused1078(delta222)Receivingobjects:100%(1855/1855),54.14MiB|701KiB/s,done.Resolvi

git - --git checkout 中的试运行选项

我使用gitcheckout--放弃我在特定目录或文件中的所有更改。每当我这样做时,GIT都会从存储库中checkout目录(或)文件。有什么方法可以告诉GIT吗?,“不要覆盖更改,只需告诉我会发生什么。”类似于gitclean-n(或)gitclean--dry-run.更新:在我执行之前,gitcheckout--src/,我想看看哪些文件会被覆盖。我知道我们可以使用gitstatussrc/.但是,拥有gitcheckout-n--src/不是很好吗??用户的命令更改不多。 最佳答案 你可以跑$gitcheckout--pat

git - 如何在 "git checkout"上更新工作目录?

考虑以下“故事”:$mkdirmy_project$cdmy_project$gitinitInitializedemptyGitrepositoryin/home/misha/misha/my_project/.git/$echo"firstline">hello.txt$gitaddhello.txt$gitcommit-m"firstcommit"[master(root-commit)9c913a1]firstcommit1fileschanged,1insertions(+),0deletions(-)createmode100644hello.txt$gitbranchne

Git:如何忽略/指定 *checkout* 文件

如果我不想跟踪.html文件,我可以将模式添加到.gitignore,它们将被忽略。我想知道如何进行相反的操作-在checkout时,我如何才能让git只checkout某些类型的文件或不checkout某些类型的文件?例如,如果我不想要html文件,我可以这样写:gitcheckoutHEAD.--no.html如果存在的话。是否已经内置了一种方法,或者我只需要在checkout后运行其他方法? 最佳答案 Git的稀疏checkout如果您只想checkout存储库的一部分,您可以使用git的稀疏checkout选项,它具有强大的

Git 文件在 checkout 、重置 --hard 等后被修改,即使 autocrlf 设置为 false

这是我的系统对话:unrollme-dev-dan:viewsDan$gitreset--hardHEADHEADisnowat3f225e9Fixscantitlesunrollme-dev-dan:viewsDan$gitstatus#Onbranchmaster#Changesnotstagedforcommit:#(use"gitadd..."toupdatewhatwillbecommitted)#(use"gitcheckout--..."todiscardchangesinworkingdirectory)##modified:app/signup/finish.html

git - 为什么git checkout带有显式的refs/heads/branch给出分离的HEAD?

如果仅使用分支名称checkout一个分支,HEAD将更新为指向该分支。$gitcheckoutbranchSwitchedtobranch'branch'如果我使用refs/heads/branch或heads/branchcheckout分支,则HEAD变得分离。$gitcheckoutrefs/heads/branchNote:checkingout'refs/heads/branch'.Youarein'detachedHEAD'state.Youcanlookaround,makeexperimentalchangesandcommitthem,andyoucandiscar

git - 为什么切换分支的 git 命令命名为 "git checkout"?

为什么切换分支的git命令名为gitcheckout?这真的有意义吗?我会将其命名为gitswitch。此外,gitcheckout还有其他含义:例如还原文件(如svnrevert) 最佳答案 我看到大多数其他答案都在解释gitcheckout的作用以及为什么“checkout”可能是描述它的合理方式。然而,虽然我非常喜欢git,但这确实触及了在我试图帮助人们理解该系统时出现的两个严重的挫折点:gitcheckout做两个截然不同的事情,如果它们是单独的命令,对新手会很有帮助。愤世嫉俗的人可能会认为git的术语是故意选择来混淆来自C

git checkout -b,分支已经存在

当我merge两个分支并且它们无法自动merge时,Github提供了这些说明:第1步:从您的项目存储库中引入更改并进行测试。gitfetchorigingitcheckout-bmasterorigin/mastergitmergedevelop第2步:在GitHub上merge更改和更新。gitcheckoutdevelopgitmerge--no-ffmastergitpushorigindevelop但是,在这种情况下,分支master已经在本地存在,并且行gitcheckout-bmasterorigin/master返回此消息:gitcheckout-bmasterorig

git - 分支 checkout 期间随机文件的权限被拒绝错误

突然间,我在检查我的本地master分支时开始收到以下错误。有问题的文件以及错误本身似乎是随机的(有时checkout工作非常正常)。"c:\ProgramFiles(x86)\Git\bin\git.exe"checkout--merge"master"Dabc123.cserror:unabletocreatefileabc123.cs(Permissiondenied)Switchedtobranch'master'Done 最佳答案 只需关闭编辑器即可解决我的问题。顺便说一下,我使用的是Atom编辑器。