Git Not Pushing或Source Tree

时间:2016-04-29 01:06:10

标签: git

根据评论:

我一直在关注bitbuckets说明

您的计算机上已经有一个Git存储库?让我们把它推到Bitbucket。

cd /path/to/my/repo
git remote add origin git@bitbucket.org:...
git push -u origin --all # pushes up the repo and its refs for the first time
git push origin --tags # pushes up any tags

我在尝试浏览Atlassian Source Tree

时收到此错误消息
git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags --set-upstream origin master:master
Pushing to C:\...
remote: error: refusing to update checked out branch: refs/heads/master[K
remote: error: By default, updating the current branch in a non-bare     repository[K
remote: error: is denied, because it will make the index and work tree inconsistent[K

remote: error: with what you pushed, and will require 'git reset --hard' to match[K
remote: error: the work tree to HEAD.[K
remote: error: [K
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to[K
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into[K
remote: error: its current branch; however, this is not recommended unless you[K
remote: error: arranged to update its work tree to match what you pushed in some[K
remote: error: other way.[K
remote: error: [K
remote: error: To squelch this message and still keep the default behaviour, set[K
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.[K
To C:\...
! [remote rejected] master -> master (branch is currently checked out)

error: failed to push some refs to 'C:\...'

然后我在git终端

中得到这个
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
fatal: The remote end hung up unexpectedly
Everything up-to-date

我添加了SourceTree(puTTy)和终端生成的SSH密钥。遵循所有步骤,但我迷路了。我就像2个小时的HA那样全新。任何人都可以带我到正确的位置。

2 个答案:

答案 0 :(得分:0)

好吧,很可能你正试图推送到本地远程存储库(听起来很奇怪,但仍然) - 位于本地硬盘驱动器上的存储库。看一下Pushing to C:\...行。

此外,目标存储库不是bare repository,正在检出分支master。默认情况下,git拒绝推送到远程非裸存储库的活动分支

最有可能的是,您打算推送到“真正的远程存储库”。我建议检查上游存储库的配置方式。要查看此内容,请尝试调用

 git -c diff.mnemonicprefix=false -c core.quotepath=false config remote.origin.url

答案 1 :(得分:0)

enter image description here

package mypackage class Hello { import org.apache.spark.rdd.RDD def get(rdd: RDD[String]): RDD[String] = rdd } scala> :load -v hello.scala Loading hello.scala... scala> package mypackage <console>:1: error: illegal start of definition package mypackage ^ scala> scala> class Hello { | import org.apache.spark.rdd.RDD | def get(rdd: RDD[String]): RDD[String] = rdd | } defined class Hello scala> :paste -raw // Entering paste mode (ctrl-D to finish) package mypackage class Hello { import org.apache.spark.rdd.RDD def get(rdd: RDD[String]): RDD[String] = rdd } // Exiting paste mode, now interpreting. 中,尝试将SourceTreeSSH Client更改为PuTTY/Plink