标签: git

Sourcetree/GIT - 拉动时无法锁定参考/参考被破坏

一个同事和我一直在同一个分支上工作一个星期,不断推/拉变化,突然今天,我点击'拉'看看是否有任何变化我需要拉,我得到一个错误.

顺便提一下,这是源码.错误是这样的:

git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin
error: cannot lock ref 'refs/remotes/origin/angular_removal': unable to resolve reference 'refs/remotes/origin/angular_removal': reference broken
From https://bitbucket.org/colossus
 ! [new branch]        angular_removal -> origin/angular_removal  (unable to update local ref)
Run Code Online (Sandbox Code Playgroud)

我在sourcetree,它有一个内置的终端,但我似乎无法在这里找到解决方案.

git git-pull atlassian-sourcetree

11
推荐指数
4
解决办法
1万
查看次数

在SSH中使用Git来提取特定目录

总的新手问题但是在使用SSH和Git时最好的做法是什么?我正在开发一个WordPress项目.在根目录中我有gulp和其他开发文件/文件夹,如SASS和Scripts,我不需要在服务器和同一项目中,我有我的WordPress文件夹,其中包含一个主题和一些自定义插件.正如您可以想象的那样,当主题或任何插件准备好部署时,我不想将服务器上的所有内容都拉出来.至于一个新手,我总是拉动并推动整个存储库并使用FTP将我需要的内容上传到服务器,那么如何使用SSH和Git完成这项工作是否有更好的方法?

编辑:为了让我的问题更清楚一点,让我举一个例子,说明我认为我的问题是什么.在我的主项目文件夹中,我的WordPress文件夹旁边有一个SASS文件夹.我真正需要部署到服务器的是WordPress文件夹.我的开发机器上发生的构建过程将所有SASS文件组合成一个CSS,然后放入WordPress文件夹.我需要Git跟踪SASS文件夹,以便任何其他开发人员可以拉动它们并继续开发,所以我不能让git忽略它.但是,这些SASS文件都不需要在服务器上供WordPress工作.我只需要部署WordPress文件夹及其中的所有内容.

我理解在服务器上创建一个裸存储库并使用post-receive hook指向位于web根目录之外的git文件夹以指向web根目录的想法.但这基本上就是GIT和SSH如何运作,而这并没有回答我的担忧.

git wordpress ssh

11
推荐指数
3
解决办法
239
查看次数

致命:无法读取当前工作目录:没有这样的文件或目录

我是Windows 10用户,使用gitbash作为命令提示符.

在我将分支更改为之后,我master突然发现此错误消息.

REDMOND+ahkim@ahkim-1211 MINGW64 /c/git/src/SI_leadscore/SalesIntelligence/LeadScore/Model (aerin/LeadOptimizerModel)
$ git checkout master
Switched to a new branch 'master'
Branch 'master' set up to track remote branch 'master' from 'origin'.

REDMOND+ahkim@ahkim-1211 MINGW64 /c/git/src/SI_leadscore/SalesIntelligence/LeadScore/Model
$ git checkout LeadOptimizerModel
fatal: Unable to read current working directory: No such file or directory

REDMOND+ahkim@ahkim-1211 MINGW64 /c/git/src/SI_leadscore/SalesIntelligence/LeadScore/Model
$ git branch
fatal: Unable to read current working directory: No such file or directory

REDMOND+ahkim@ahkim-1211 MINGW64 /c/git/src/SI_leadscore/SalesIntelligence/LeadScore/Model
$ git status
fatal: Unable to read current working directory: …
Run Code Online (Sandbox Code Playgroud)

git

11
推荐指数
2
解决办法
1万
查看次数

stithed文件在`git status`中显示为未更改(git v.2.16.0)

我使用git换窗户v2.16.0和遇到以下问题,ALSE报道在这里:

我最初的工作状态很干净; 输出'git status':

git status
On branch beta
nothing to commit, working tree clean
Run Code Online (Sandbox Code Playgroud)

然后我进行局部更改.产量git status:

git status
On branch beta
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   app/src/main/java/android_serialport_api/sample/Debug.java

no changes added to commit (use "git add" and/or "git commit -a")
Run Code Online (Sandbox Code Playgroud)

然后我用'git stash'藏匿它们:

git stash
Saved working directory and index state WIP on beta: 2fca403 …
Run Code Online (Sandbox Code Playgroud)

git git-for-windows

11
推荐指数
1
解决办法
148
查看次数

合并时仅忽略某些文件扩展名的空格

我有这个命令

git merge -Xignore-all-space origin/dev
Run Code Online (Sandbox Code Playgroud)

让我有点害怕b/c我害怕合并一个空白很重要的文件.有没有办法将其限制为某些文件,如下所示:

git merge -Xignore-all-space *.js origin/dev
Run Code Online (Sandbox Code Playgroud)

javascript git git-merge node.js

11
推荐指数
1
解决办法
218
查看次数

Visual Studio Code中的“ git add”在哪里?

在Visual Studio Code中,Cmd-Shift-P为我提供了命令面板。调色板中列出了许多Git命令,但是“添加”的唯一结果是“将文件添加到.gitignore”。这不是我想要的。我想要相当于git add $CURRENT_FILE。例如,通过Atom的git-plus扩展提供了这样的命令。在Visual Studio Code中等效的是什么?

git visual-studio-code

11
推荐指数
1
解决办法
3111
查看次数

在Gitlab上,如何比较两个不同提交的文件

在Gitlab上,如何比较两个不同提交的文件?我知道在命令行git上,该命令是:

git diff commit1 commit12-file_name

在gitlab上执行此操作的链接格式是什么?

看到我的相关问题

git gitlab

11
推荐指数
5
解决办法
1万
查看次数

自动合并package-lock.json

git merge --no-ff account-creation
Run Code Online (Sandbox Code Playgroud)

自动合并package-lock.json CONFLICT(内容):package-lock.json中的合并冲突自动合并失败; 修复冲突,然后提交结果.

关于这个问题的任何想法?

git github gitlab

11
推荐指数
1
解决办法
5469
查看次数

如何修复git中的"修改内容,未跟踪内容"?

目标是提交一个git分支.分支的"git status"输出为:

On branch zeromq_new
Your branch is up to date with 'origin/zeromq'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)

      modified:   log4cplus (modified content, untracked content)
      modified:   ../lib/notification/cppzmq (modified content)
Run Code Online (Sandbox Code Playgroud)

目录结构如下所示:

HySecureGateway
???fes
?   ???log4cplus
?       ???.git
?       ???.gitattributes
?       ???.gitignore
?       ???.gitmodules
?       ???catch
?       ?   ???.git
?       ?   ???.gitattributes …
Run Code Online (Sandbox Code Playgroud)

git git-submodules

11
推荐指数
4
解决办法
2万
查看次数

如何通过哈希显示提交的日期和时间

我曾经git reflog在创建特定分支时标识哈希值。我得到的哈希值fe1ddcdef。我尚未将此分支推送到远程。我现在正在寻找发生日期和时间fe1ddcdefgit reflog只显示给我:

fe1ddcdef HEAD@{11}: checkout: moving from master to handoff

没有日期或时间。

git log太冗长了,因为它包含了我所有同事的提交,而我fe1ddcdef在那堆干草堆中找不到针头。

我怎样才能简单地找到提交的日期和时间fe1ddcdef

git

11
推荐指数
4
解决办法
5155
查看次数