草庐IT

checkOut

全部标签

git - 同时 git add -p 和 git checkout -p

我正在手动审查通过搜索和替换脚本对某些消息目录所做的大量更改(在1000多个更改中)。目前我正在执行gitadd-p,但我一直在休息以检查其他文件或调整脚本,所以我交替使用gitcheckout-p放弃我不想要的更改。有没有办法将两者结合起来?IE。对于每个大块头,我都希望选择暂存它或丢弃它。 最佳答案 如果您使用的是Windows或Mac操作系统,您可以免费使用SourceTreeGUI应用程序允许您在差异View中暂存或丢弃每个block(甚至从每个block中选择行)。 关于git

windows - git checkout 错误 : unable to create file

在将git存储库从Linux克隆到Windows系统时,我在检查阶段遇到以下错误:$gitclonegituser@serveraddr:/git/git_repo.gitgit_WACloninginto'git_WA'...gituser@serveraddr'spassword:remote:Countingobjects:500846,done.remote:Compressingobjects:100%(118676/118676),done.remote:Total500846(delta307739),reused483023(delta291136)Receivingo

git - jenkins 在 checkout 前清除存储库并强制克隆 vs Clean

我试图理解用于pullgit存储库的“清除存储库并强制克隆”和“checkout前清理”这两个选项之间的区别。查看这两个选项的帮助部分,两者似乎具有相似的功能,我无法区分。它们的外观如下:Wipeoutrepository&forceclone:Deletethecontentsoftheworkspacebeforebuilding,ensuringafullyfreshworkspace.checkout前清洁Cleanuptheworkspacebeforeeverycheckoutbydeletingalluntrackedfilesanddirectories,includi

git - 不同 Remote 上的 checkout 分支

我有一个repo,除了origin之外还有另一个远程upstream。我可以执行gitcheckoutorigin/master,但是当我运行gitcheckoutupstream/master时,我得到:error:pathspec'upstream/master'didnotmatchanyfile(s)knowntogit.这也不起作用:$gitfetchupstreamFromhttps://github.com/getsentry/sentry*branchHEAD->FETCH_HEAD$gitco-basdf--trackupstream/masterfatal:Cann

git - 为什么 Git 在我运行 "Not currently on any branch"后告诉我 "git checkout origin/<branch>"?

我试图按照Git:"Notcurrentlyonanybranch."Isthereaneasywaytogetbackonabranch,whilekeepingthechanges?中的说明进行操作但是gitcheckout似乎被破坏了:$gitcheckoutorigin/web-zachHEADisnowat1366cb1...Changedsocssfilesnotignored$gitstatus#Notcurrentlyonanybranch.#Untrackedfiles:#(use"gitadd..."toincludeinwhatwillbecommitted)##

git - 错误 : The following untracked working tree files would be overwritten by checkout

当我执行gitstatus时,它说nothingtocommit,workingdirectoryclean然后我执行gitpull--rebase,它说:First,rewindingheadtoreplayyourworkontopofit...error:Thefollowinguntrackedworkingtreefileswouldbeoverwrittenbycheckout:includes/resources/moduledata/12/_Fr4_02_Invention_IPA_SR_la-Fête.pdfPleasemoveorremovethembeforey

Git checkout - 切换回 HEAD

我一直在做我的项目,而在某个时候我发现有一件事停止了工作。当我的代码正常工作时,我需要查看它的状态,所以我决定使用gitcheckout(因为我想检查一些东西)。所以我已经完成了gitcheckoutSHA几次回到我无法到达HEAD的点时,输出如下:gitcheckoutSHA-HEADerror:Yourlocalchangestothefollowingfileswouldbeoverwrittenbycheckout:[listoffiles]Please,commityourchangesorstashthembeforeyoucanswitchbranches.Abortin

git 尝试在 checkout 时删除目录

每当我在分支(Li)和主分支之间切换时,我都会收到以下消息:Deletionofdirectory'sys/console/api'failed.ShouldItryagain?(y/n)任何人都知道如何摆脱这条消息?我认为过去我试图错误地删除这个目录,现在我被这个错误消息困住了。 最佳答案 此错误信息来自thispatch(在compat/mingw.c中)和thisone(也在compat/mingw.c中)。这通常意味着您的目录“忙”或不为空(但仅包含私有(private)文件,即非版本文件)。因此请确保,在checkout分

macos - git checkout -- <files> 不丢弃更改?

我在我的工作目录中有我试图放弃的更改(重置为文件的当前索引版本),但是,gitcheckout--不会丢弃更改。我试图手动删除文件(rm-rfiles)然后运行​​gitcheckout--.,再次显示已修改的文件。$gitcheckout--.$gitstatus#Onbranchmaster#Changesnotstagedforcommit:#(use"gitadd..."toupdatewhatwillbecommitted)#(use"gitcheckout--..."todiscardchangesinworkingdirectory)##modified:files/Hu

git - zsh : alias gco ='git checkout' 中别名子命令的 Tab 补全

我有一个别名:aliasgco='gitcheckout'如何像输入gitcheckout一样添加制表符补全?对于我的aliasg='git',我使用compdefg='git'。我一直在尝试使用compdef但我没有取得任何成功。 最佳答案 禁用此选项,你也很好......#don'texpandaliases_before_completionhasfinished#like:gitcomm-[tab]#setoptcomplete_aliases 关于git-zsh:aliasgc