标签: git-remote

将远程heroku repo添加到我现有的本地仓库后,无法推送到heroku

这是场景:

1)我的项目合作伙伴和我正在使用github作为我们的代码仓库一起开发Ruby on Rails应用程序.

2)该应用程序在她的github帐户下,她已将我添加为合作者

3)她部署到Heroku并在那里加入我作为合作者

4)我在现有的app目录中使用了以下命令,目的是将现有的Heroku远程应用程序添加为现有本地应用程序的远程应用程序.正如我之前提到的,我现有的本地应用程序已经有了一个远程github

git remote add heroku git@heroku.com:codefellow.git 
Run Code Online (Sandbox Code Playgroud)

5)我做了一些修改并将它们推送到github,所有这些都是最新的

6)然后我尝试使用以下命令推送到heroku

git push heroku master
Run Code Online (Sandbox Code Playgroud)

7)这给了我一个错误,说我的分支的提示落后了,如下所示,但是当我试图从github拉出时,它说我已经更新了,如下图所示

?  code-fellows-alumni git:(master) git push heroku master
To git@heroku.com:codefellow.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@heroku.com:codefellow.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' …
Run Code Online (Sandbox Code Playgroud)

git ruby-on-rails github heroku git-remote

7
推荐指数
1
解决办法
5440
查看次数

删除的Git标签可以自行恢复

我们最近遇到了Git存储库中的标签问题.

我们在本地和远程删除了我们的标签,但每次我们推送或从远程获取时它们都会自动恢复.

我们目前正在组建一个三人小组,当我们认为我们实际上已经摆脱了标签时,有人会做出推动,我们都会再次获得它们.

我们都试过了:

git tag -d 12345
git push origin :refs/tags/12345
Run Code Online (Sandbox Code Playgroud)

其他人遇到过这个问题?

git git-remote git-tag

7
推荐指数
1
解决办法
1177
查看次数

git远程名称中哪些字符是非法的?

git远程名称中哪些字符是非法的?

我没有发现它是git文档.

git git-remote

7
推荐指数
1
解决办法
1360
查看次数

Git - 新分支和远程跟踪(使用 origin/master 配置推/拉)

有什么Track Remote Branch作用?还有什么意思呢configure for push/pull with origin/master

git visual-studio git-remote

7
推荐指数
1
解决办法
6541
查看次数

当我推送到有效的SSH地址时,为什么git无法解析主机名?

我正在Heroku上部署一个应用程序,所以我从一个repo创建了一个Heroku应用程序然后做了git push heroku master.当我这样做时,它一直给我错误:

!  Your key with fingerprint xxx is not authorized to access heroku-app.

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)

我尝试了各种更改SSH密钥的方法,包括删除所有密钥并创建新密钥.它仍然给我同样的错误.我已将密钥添加到Heroku.

然后我尝试运行ssh -vT git@heroku.com:heroku-app.git,结果是:

OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 53: Applying options for *
ssh: Could not resolve hostname heroku.com:heroku-app.git: nodename nor servname …
Run Code Online (Sandbox Code Playgroud)

git ssh heroku ssh-keys git-remote

6
推荐指数
1
解决办法
6696
查看次数

Git列出不存在的遥控器

我最近在我的Git repo配置文件中对我的远程存储库进行了一些更改.我重命名了远程名称,将我的原点更改为另一个远程仓库并重命名我的旧源.

例如,我之前有这个:

[remote "origin"]
   url =  blah blah

[remote "future"]
   url = blah blah
Run Code Online (Sandbox Code Playgroud)

我进去改变它们看起来像这样:

# formerly the origin
[remote "old-origin"]

# formerly the future repo
[remote "origin']
Run Code Online (Sandbox Code Playgroud)

但现在,当我打字时git branch -a,我看到旧的'未来'遥控器上列出的分支:

remotes/origin/HEAD
remotes/origin/branch1
remotes/origin/branch2
remotes/future/branch1
remotes/future/branch2
remotes/old-origin/master
remotes/old-origin/branch3
Run Code Online (Sandbox Code Playgroud)

我运行了修剪以及获取等等,但该列表不会更新.我在配置文件中搜索了"future",但没有任何结果.是否有任何命令可以运行以刷新此列表并停止查看该不存在的遥控器?

git git-config git-remote git-branch

6
推荐指数
1
解决办法
1325
查看次数

在远程运行git命令?

我已经看到了:

由此判断,对于我想要做的事情,我必须登录ssh并在远程服务器上运行脚本; 但我希望有更多的git集成解决方案,所以让我解释一下我想做什么.

我有一个远程仓库,它是git-svn; 然后我有一个本地git-only repo,它是遥控器的克隆.因此,本地有一个对远程URL的引用remote.origin.url(见过git config --list).

我想要做的是git svn log,在遥控器上运行相当于(可能有一些后处理),但是从本地 …

git git-remote

6
推荐指数
1
解决办法
3486
查看次数

Visual Studio 2013中的Git远程操作导致错误"指定的登录会话不存在.它可能已经被终止"

我在Visual Studio 2013中使用Git.当我尝试对远程执行任何操作时,如fetch,pull,push等.我收到以下错误:

发生错误.详细消息:libgit2引发了一个错误.Category = Net(错误).指定的登录会话不存在.它可能已经被终止了

我无法找到答案,但最终找到了两个解决方案.我将在这里发布解决方法.

  1. 我下载了Git,所以我可以在Visual Studio之外使用它.如果我在命令行上运行git远程命令,他们工作得很好,所以问题不在于git或我的远程git存储库.

  2. 每当我通过Visual Studio进行远程git操作时,它都会使用标准的Windows对话框来捕获密码.我注意到如果选中"记住我的凭据"框,我将始终收到错误.如果我取消选中它,它会正常工作.

在此输入图像描述

git git-remote visual-studio-2013

6
推荐指数
2
解决办法
1242
查看次数

Git - 用远程分支替换本地分支

我知道这个问题已被问到,但我似乎无法完全用我的远程分支替换我的本地分支.我在我的本地分支机构安装了第三方插件,但是在删除安装时遇到了问题.因此,我想用分支的远程版本"重新开始".该分支在本地称为"dev",远程称为"origin/dev".我尝试了三种用远程版本替换本地分支的方法:

1. git reset HEAD --hard

2. git reset --hard origin/dev

3. git checkout dev
   git fetch
   git reset --hard origin/dev
Run Code Online (Sandbox Code Playgroud)

但是在执行上面的git命令后查看本地代码,我仍然可以从插件中看到剩余的文件和文件夹.

使用git status,我明白了"Your branch is up-to-date with 'origin/dev'. Nothing to commit, working directory clean".

使用git status --ignored,我得到太多的文件列出...基本上我的.gitignore文件中的所有内容我相信.

我只想要远程开发分支中存在的代码而不需要其他内容.

有人可以帮忙吗?

更新:

事实证明,我得到的错误是由于目录中的一堆文件造成的root/var/cache/*.我的.gitignore文件包含以下条目:

/var/*
!/var/package
var/session/*
Run Code Online (Sandbox Code Playgroud)

尝试从远程恢复本地开发分支的可能方法(在上面的问题中列出以及下面提出的解决方案),该root/var/cache目录仍然存在; 在我的应用程序再次开始运行之前,我不得不手动删除它.查看github,远程dev分支不包含'root/var/cache . Can anybody tell me whyroot/var/cache`没有响应git命令用于替换远程版本的本地分支?

git git-remote git-branch

6
推荐指数
1
解决办法
2330
查看次数

无法推送到Github(这超出了GitHub的文件大小限制)

我的本地分支不会上传,因为掌握,作为错误输出状态,"下载/ ue4-test-8.zip为363.08 MB,这超过了100.00 MB GitHub的文件大小限制为"我已经删除此文件,还没有任何提交我让被拒绝.

  • 我删除了大文件.
  • 我以为一切都会好的,所以我在呼吸道中添加了新文件
  • 现在我在推送一个不存在的文件时遇到错误

我怎样才能解决这个问题并重新推回这个回购?

这是我的输出日志:

~\Documents\GitHub\mryamz.github.io [master ?6 +0 ~1 -0 !]> git push
Counting objects: 42, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (28/28), done.
Writing objects: 100% (42/42), 360.48 MiB | 668.00 KiB/s, done.
Total 42 (delta 18), reused 36 (delta 13)
remote: Resolving deltas: 100% (18/18), completed with 6 local objects.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com. …
Run Code Online (Sandbox Code Playgroud)

git github git-push git-remote

6
推荐指数
4
解决办法
3884
查看次数