我在我的服务器上有一个git存储库,我可以通过端口443 ssh.但是现在我想从该服务器拉出并推送到它但是git让我拒绝连接.我认为它通过端口22连接,但我希望它通过443连接.我使用tortoiseplink连接如何在推或拉时通过端口443连接?
我试图推送到远程仓库,但继续得到下面的错误.
$ git push
To user@remote.net:/home/user/repos/remoterepo.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'user@remote:/home/user/repos/remoterepo.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
Run Code Online (Sandbox Code Playgroud)
git remote show origin节目master pushes to master (local out of date).我很肯定它不应该过时,因为我只从分支机构推出.
我有两个问题.
是否可以强制本地分支覆盖遥控器?拉取将覆盖更改,这些更改肯定会晚于存储库中的内容.
这是我第二次或第三次遇到这个问题.我唯一能想到的是git的本地版本git version 1.7.3.1.msysgit.0(在Windows上)和远程版本是git version 1.6.5(Ubuntu Jaunty).是否有可能不同的git版本可能导致一些损坏?
以下命令的意义是什么:
git pushgit push origingit push origin master我在github上有一个iOS项目设置,在过去的几天里我开始意识到我需要重构我的大部分代码.我构建的项目不遵循MVC的许多基础知识,现在想回去修复所有内容.
主要问题是项目足够大,重构将是一个巨大的痛苦.无论如何,我可以启动一个新项目,将它构建到当前所在的位置(显然有一些重大的设计更改)并将其推送到同一分支而不是原始项目的github?如果不清楚,请告诉我.
我试图在我的网站上使用git.该网站在我们的网络服务器上.
mkdir /home/website/public_html
cd /home/website/public_html
git --bare init
Run Code Online (Sandbox Code Playgroud)
然后我转到本地机器并切换到我的文件目录
git remote rm origin
git remote add origin git@server.com:/home/website/public_html
git push origin master
Enter passphrase for key '/c/Users/git/.ssh/id_rsa':
Counting objects: 6, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (6/6), 460 bytes, done.
Total 6 (delta 0), reused 0 (delta 0)
To git@server.com:/home/website/public_html
* [new branch] master -> master
Run Code Online (Sandbox Code Playgroud)
但现在当我回到我的服务器时:
ls /home/website/public_html
branches config description HEAD hooks info objects refs
Run Code Online (Sandbox Code Playgroud)
我推送到服务器的文件在哪里?我是以错误的方式来做这件事的吗?(我推出的本地文件夹中唯一的东西是自述文件)
我克隆了我的github.
并打开几个文件,更改了一些code,现在我想将此代码发布到我的githu.com/user/repo.git存储库.但是当我这样做..
root@linux# cd myRepo/
root@linux# git commit -a -m "Updated footer"
root@linux# git push origin master.
Run Code Online (Sandbox Code Playgroud)
我收到以下错误: -
fatal: remote error:
You can't push to git://github.com/user/repo.git
Use https://github.com/user/repo.git
Run Code Online (Sandbox Code Playgroud)
请不要告诉我google的路径,我已经尝试过它们并且在失败之后,我在这里写它们.
我搜索了一下,但似乎找不到答案.
在我可以访问的两个框中,当我执行"git push --dry-run origin mytestbranch"时,我得到以下结果:
To git@bitbucket.org:rien/test.git
* [new branch] test -> test
Run Code Online (Sandbox Code Playgroud)
但是,在我的macbook上,当我尝试相同的命令时,我得到以下结果:
To git@bitbucket.org:rien/test.git
417248a..cf7d564 test -> master
Run Code Online (Sandbox Code Playgroud)
只有当我明确地说推送到测试原点branch(git push --dry-run origin test:test)时它才能按预期工作.
如何更改它以便基本git push --dry-run bb test将推送到新创建的远程分支而不是主控?
我用两个盒子在盒子上创建了测试分支 git checkout -b test origin/master
编辑添加: - 两个分支都git config push.default设置为tracking.
我特别想知道如何配置git,以便在我输入时git push origin test它的行为与...相同git push origin test:test
我的设置如下:
我在Mac上运行git版本2.3.2(Apple Git-55)。这有一个非裸露的git仓库,位于~/xyz。
然后,我在同一台Mac上使用VMWare Fusion运行Windows 7 64bit。VM具有git 1.9.5,这是Windows的最新git版本。从VM中,我可以克隆并从Mac的非裸仓库中拉出~/xyzOK,但是我不能将其推入。我遵循了这里的建议并继续使用receive.denycurrentbranch=ignore,~/xyz但仍然给我相同的错误消息:
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can …Run Code Online (Sandbox Code Playgroud) 我有一些尚未推送的提交。但是存储库中有几个新的提交。我想提取新的提交并推送我的提交,但是我不确定执行此操作的正确方法是什么。如果我按原样进行拉动,但我认为它会尝试合并,并且我不确定提交的内容,请提出针对这种情况的解决方案。
当我这样做时,git push --force我会看到下一个输出git:
$ git push --force
Counting objects: 21, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (21/21), done.
Writing objects: 100% (21/21), 2.36 KiB | 1.18 MiB/s, done.
Total 21 (delta 14), reused 0 (delta 0)
To repo:/v1/repos/DB-Hooks
+ 7b4eaa2...1295174 reimplement -> reimplement (forced update)
$ git log --graph --decorate --pretty=oneline --abbrev-commit 7b4eaa2...1295174
* 1295174 (HEAD -> reimplement) TEMPORARY
* 0f477bf Prettify code
* 09630ef Setup $DB::single
* 7b4eaa2 TEMPORARY
Run Code Online (Sandbox Code Playgroud)
如何从此日志中查看此处发生的情况? …