我试图在 git commit 之后推送我的项目,但遇到错误:
git push
sign_and_send_pubkey: signing failed for RSA "/home/acer/.ssh/id_rsa" from agent: agent refused operation
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)
已连线,因为我之前在同一项目上推送了其他更改,并且此错误仅出现在这个项目中!!!!
我们正在使用 git 中的一个非常简单的结构。
首先我们有我们的master分行。
下面我们有develop
最后我们可以拥有任何feature分支
我们仅使用 rebase 来更新分支上的历史记录,然后转发到上述分支。
每周,我们的develop分支都会更新一些features. 这个分支被重新定位并合并到 master 中(从develop到master)。
问题
当我们变基并合并develop到时master,有时会出现冲突,我必须通过master在我的develop分支中执行变基来修复它们。解决冲突后,我执行git push --force-with-lease将更改上传到远程。
在此过程之后,由于强制推送,开发的历史已被更改。
问题在于,当另一位开发人员正在feature基于develop强制推送之前(develop强制推送之前)的分支进行工作时。
我们如何feature使用新的develop分支历史记录来更新该开发人员的分支。git rebase develop 因为,在我们的分支机构内部进行操作时feature。我们最终会产生很多冲突。
我正在写我的论文,我在那里扩展了另一篇论文。本文已在存储库 X 中公开了他们的所有代码,同时还使用了自己的子模块:我们将其称为 Y。
对于我自己的项目,我创建了一个自己的存储库 Z,其中包含 X 作为子模块,因此 Y 作为嵌套子模块。但是,我想对 X 和 Y 中的代码进行更改,并且还能够将其推送到我自己的存储库,以便我可以在多个位置使用它。我没有 X 和 Y 的推送权限,因为它是别人的仓库。解决这个问题的最佳方法是什么?预先感谢,我迷路了:D
我尝试将我自己的存储库推送到其主目录中,但它不包含我在子模块中更改的代码。当我进入子模块并在那里提交更改的代码时,我首先发出了分离头的警告。当我通过签出新分支来修复此问题时,它现在给我:
git push --set-upstream origin new_branch
ERROR: Permission to \[repo X\] denied to \[myusername\].
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)
我现在分叉了存储库 X 并更改了 .gitmodules 中的 url。子模块 Y 现在发生了什么?
我们在sourcerepo.com上有一个裸git存储库.有时,在推动时,我们得到"错误:未能推送一些参考",但推动成功,如果有什么遗漏,则不明显是什么.这不是常见的问题,你必须在你可以推动之前拉动; 看到:
2t2% git pull
remote: Counting objects: 57, done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 30 (delta 25), reused 0 (delta 0)
Unpacking objects: 100% (30/30), done.
From tiptap.sourcerepo.com:tiptap/2t2
cb6c0e5..1dfea54 master -> origin/master
Merge made by recursive.
app/stylesheets/facebox.scss | 11 +++
app/stylesheets/screen.scss | 28 ++++++--
app/views/answers/tip_detail.html.erb | 2 +
app/views/shared/_tip_box.html.erb | 26 ++++---
app/views/tip/tip_answer.js.erb | 37 ++++++++++-
config/application.rb | 2 +-
public/javascripts/application.js | 1 -
public/javascripts/tip_animation.js | 116 +++++++++++++++++++++++++++++++++
public/stylesheets/facebox.css | 11 +++
9 files changed, 212 …Run Code Online (Sandbox Code Playgroud) 嗨,我正在使用Github将一些文件从我的本地服务器推送到我的Github存储库.我不小心在提交中包含了一个500Mb的视频文件,我认为这完全搞砸了add/commit/push.
具体来说,我的命令push就像这样停顿:
git push -u myGithubRepository master
Counting objects: 52, done.
Delta compression using up to 4 threads.
Compressing objects: 97% (36/37)
Run Code Online (Sandbox Code Playgroud)
这已经很多个小时了,仍然停滞不前.
我想提交我做的所有其他更改,所以我不想回复到我的Github存储库中的内容.我只是想解决这个冲突.我是Git新手所以请你放轻松.
谢谢,蒂姆
在我的本地计算机上,我有一个存储库设置如下
* remote origin
Fetch URL: git@github.com:me/my_project.git
Push URL: git@github.com:me/my_project.git
HEAD branch: master
Remote branches:
mac-master tracked
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (local out of date)
Run Code Online (Sandbox Code Playgroud)
本地只有master分支,我想总是将我的本地主服务器推送到远程分支.我应该这样做: mac-master
git push origin master:mac-master
Run Code Online (Sandbox Code Playgroud)
每次我需要推?如果没有,这样做的正确方法是什么?
我知道有时当我跑步时git push,我得到这个错误:
error: failed to push some refs
To prevent you from losing history, non-fast-forward updates were rejected
Run Code Online (Sandbox Code Playgroud)
有人能举例说明如果推送非快进更新,历史会丢失的情况吗?根据我的理解,当我这样做时git push,git会简单地将我的提交推送到远程存储库而不删除任何现有的提交,那么它将如何丢失历史记录?
谢谢!
嗨,我正在关注rails应用程序的初学者教程.但我在推送存储库时遇到了问题.每次我正在做和git push -u到origin master我有这个错误.
guinslym@ubuntu:~/Documents/rails_tuto/first_app$ git remote add origin https://github.com/guinslym/first_app.git
fatal: remote origin already exists.
guinslym@ubuntu:~/Documents/rails_tuto/first_app$ git push -u origin master
Warning: Permanently added the RSA host key for IP address '192.30.252.130' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
guinslym@ubuntu:~/Documents/rails_tuto/first_app$
guinslym@ubuntu:~/Documents/rails_tuto/first_app$ ssh -vT git@github.com
OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config …Run Code Online (Sandbox Code Playgroud) 我写了一个不正确的提交消息,我把它推到了遥控器上.有很多问题已经解决了这个问题:
只是一对.但是他们似乎都终止了git push --force,并且关于为什么这是一个坏主意的额外警告 - 它编辑了历史,这意味着使用存储库的每个人在尝试拉动时都会受到影响.他们似乎并没有说"正确"的事情是什么.
那么处理这种情况的建议或"正确"方法是什么?我以为我可以添加额外的消息git commit --allow-empty,但据说有" 很少有理由这样做 ".为--allow-empty确实解决的事情以正确的方式?如果没有,什么是正确的做法?
注意:以"正确的方式"做事可能涉及"承认我搞砸了".作为我正在寻找的一个例子,该git tag手册页讨论了重复推送标签.它清楚地讨论了重新标记错误标记的提交的方法,给出了推荐的行动方案和一种--force做事方式.
我已经配置了一个post-receive用于与GIT中自动部署服务器上钩子脚本,如例如描述在这里.
因此,当我在本地PC上发送生产服务器时:
git push production master
Run Code Online (Sandbox Code Playgroud)
该post-receive钩被触发,复制存储库的活动目录中的内容.
我的问题是,post-receive当我发送推送时,是否有某种方法将一些参数传递给钩子?
像这样的东西:
git push production master --params="clear-the-cache=1"
Run Code Online (Sandbox Code Playgroud)
然后在钩子内我可以读取'clear-the-cache=1'参数并执行其他操作.
有办法吗?
git ×10
git-push ×10
github ×4
git-commit ×2
commit ×1
deployment ×1
git-fork ×1
git-history ×1
githooks ×1
hook ×1
rebase ×1