我的同事将生产修补程序的一些更改合并到他的本地主分支中,然后将主服务器推送到我们的GitHub存储库.现在我尝试用他的更改来更新我的本地主分支.当从git控制台执行"git pull origin"时,通过显示所有文件似乎可以正常运行.但是,接近结束时它只是停止了"Aborting"消息.
我不知道接下来该做什么.救命?
更新: 问题解决了.问题的真正根源是我的同事从他的分支中的.gitignore文件中删除了一些条目,这些条目允许几个新文件进入他的签入.由于我的本地.gitignore仍然忽略这些文件,我的本地仓库并不认为我有本地工作文件要添加到索引中.我最终删除了所有文件,然后拉动工作并将它们全部带入.
我肯定会更仔细地编辑.gitignore文件并将其检入.我现在对其对其他开发人员的影响有了新的认识.
当我git pull [project name] master用来更新我的核心文件时,我在"递归合并"下获得了一堆绿色加红色和红色减号信号.这些符号是什么?它们是什么意思?
这是一个截图:

谢谢您的帮助.
我正在使用以下命令运行git守护程序.
c:\cygwin\bin\git daemon --reuseaddr --base-path=/cygdrive/S --export-all --verbose --enable=receive-pack
Run Code Online (Sandbox Code Playgroud)
我能够克隆并提取更新,但是当我尝试推送时,我得到了
$ git push origin master
Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (6/6)
Run Code Online (Sandbox Code Playgroud)
然后它挂了
我目前正在使用git版本1.7.0.4
我是Git的新手,无法理解如何使用Git.我一直在使用CVS,因此需要为Git学习一些学习曲线.这就是我所尝试的一切
现在我只更改了两个文件PromoServiceImpl.java和build.sql.但是合并有问题从"产品"分支改变了.
您看到的剩余文件(如ApiServiceImpl.java等)是来自其他用户的更改,但我不确定此处的表示是否表明我已更改它们.问题是它在早期的pull命令中合并了,现在它希望我提交它们?
无论我遵循什么命令流(即使在谷歌搜索之后),我都会看到以下错误:
您尚未完成合并(MERGE_HEAD存在)请在合并之前提交您的更改.
这是我遵循和输出的命令序列(试图通过插入新行供每个人阅读来使其漂亮).即使在重新从存储库中进行更改之后,这个错误也会回来,所以我确信我做错了而不是git的一些问题.
kamal@kamal-Lenovo-G470:~/git/TryGit$ gs
# On branch product
# Your branch is ahead of 'origin/product' by 1 commit.
#
# 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: TryGitServices/src/main/java/com/TryGit/services/promo/impl/PromoServiceImpl.java
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# Adding
no changes added to commit …Run Code Online (Sandbox Code Playgroud) 我有一个远程存储库和2个克隆.
我在其中一个克隆中创建了一个分支,例如test.我做了一些工作和2次提交.我合并到master分支和push -u分支.
我git pull在另一个克隆中做了一个.
我看到了两个master和test.
在我做的第一个克隆项目中:
git origin :test删除test远程存储库上的分支.
test在远程回购中被删除.
我这样做git branch -D test,test分支也在本地删除.
如果我这样做,git branch -a我得到:
*master
remotes/origin/master
Run Code Online (Sandbox Code Playgroud)
现在在第二个存储库中我做了一个git pull.
在拉动局部test似乎被删除但git似乎"认为"远程test分支仍然存在.
如果我这样做,git branch -a我得到:
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/test
Run Code Online (Sandbox Code Playgroud)
为什么删除的test分支显示为远程分支?
我正在使用Git与其他用户合作,但今天我无法使用" git pull" 获取某些文件的最新更改,而我无法看到" git log"中的更改.
可能是什么问题?
我从github分叉了一个项目,原点指向我自己的github仓库,远程指向它的原始仓库,因为我想从远程获取更新,
我使用git pull remote branch_name,然后我的本地repo处于冲突模式,现在我想取消git pull的效果,所以我使用git stash,但是很惊讶地发现我没有这样做?怎么了?
详细信息如下:
[mirror@home weechat]$ git status
# On branch master
# Unmerged paths:
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# both modified: CMakeLists.txt
# both modified: ChangeLog
# both modified: NEWS
# both modified: configure.in
# both modified: po/cs.po
# both modified: po/de.po
# both modified: po/es.po
# both modified: po/fr.po
# both modified: po/hu.po
# both modified: po/ru.po
# both modified: po/weechat.pot
# deleted by us: src/irc/irc-server.c
# …Run Code Online (Sandbox Code Playgroud) 我已经更改了我朋友正在同时工作的文件.我做了一些改变,现在我想推它,但它说我应该先拉.当我git pull,它说:
错误:对以下文件的本地更改将被合并覆盖:请提交更改或存储它们,然后才能合并.
中止
我该如何合并文件?如果我这样做,我朋友的文件会彻底改变吗?我相信他已经添加了一些东西,我添加了我的东西.我们的变更将如何处理?
所以 - 有人可以澄清这个:
我跑:
git pull origin master
git status
Run Code Online (Sandbox Code Playgroud)
然后它就会提出改变并说:
your branch is ahead of origin/master ... blahblah by 6 commits...
Run Code Online (Sandbox Code Playgroud)
当我跑的时候
git fetch
git status
Run Code Online (Sandbox Code Playgroud)
它说:
# On branch master
nothing to commit (working directory clean)
Run Code Online (Sandbox Code Playgroud)
所以 - 我认为git pull默认情况下会执行git fetch - 那么为什么它会在没有额外的情况下"提前6次提交" git fetch呢?
我在这里看到了一些类似的问题,但是给出的解决方案似乎都不起作用...想知道它们是否已经过时,或者这种情况在某种程度上有所不同...所以我想打开一个新线程谈论它。
我遇到了一个令人沮丧的问题,每次执行 和 时git pull,它都会将所有者更改为拉取者的用户。然后发生的情况是该网站显示以下错误:
Warning: file_get_contents(/var/www/html/wp-content/themes/<my-theme>/resources/views/<changed-file>): failed to open stream: Permission denied in /var/www/html/wp-includes/class-wp-theme.php on line 1207
这只能通过运行chown www-data更改的文件来修复。
当更多的人开始在网站上工作时,或者当重要文件发生更改(默认模板/页眉/页脚..)时,这将成为一个问题,并且网站将变为空白,直到运行 chown。
Laravel、wordpress、ubuntu 18、armor 托管
Git 存储库存储在自定义主题中
我尝试了一些解决方案,但似乎都不起作用,(也许是因为它们实施不正确......)
1:将文件模式设置为 false - 我在本地计算机和相关服务器上将文件模式本地和全局设置为 false。我也尝试过将大小写更改为“fileMode”。
2:实现更新后挂钩 - 我添加了一个更新后挂钩来自动更新文件权限/所有权。这是脚本(请注意,git 存储库位于自定义主题中):
#!/bin/sh
# default owner user
OWNER="www-data:www-data"
# changed file permission
PERMISSION="664"
# web repository directory
REPO_DIR="/var/www/html/wp-content/themes/quorum-theme"
# remote repository
REMOTE_REPO="origin"
# public branch of the remote repository
REMOTE_REPO_BRANCH="master"
cd $REPO_DIR || exit
unset GIT_DIR
files="$(git diff-tree -r …Run Code Online (Sandbox Code Playgroud)