作为我在svn到git迁移后关于不可用分支的问题的后续跟踪,我有一个不同的问题:我无法将新分支推送到我的中央Git存储库.
$ git clone ssh://server/opt/git/our_app.git
$ cd our_app
$ git branch my-test-branch
$ git checkout my-test-branch
$ echo test > test.txt
$ git add test.txt
$ git commit test.txt -m "test commit"
[master ed81ec0] test commit
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 test.txt
$ git push
Everything up-to-date
Run Code Online (Sandbox Code Playgroud)
所以,这不会将我的分支推送到服务器.一位同事建议我查看我的.git/config,看起来像这样:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = ssh://server/opt/git/our_app.git
[branch …Run Code Online (Sandbox Code Playgroud) 我在Windows上玩GIT.已安装的msysgit(最新版本)似乎一切都很好看.我在我的c:/ repo文件夹上创建了裸存储库,我将其克隆到c:/ repoclone /并使用以下命令:
git clone git://localhost/repo
Run Code Online (Sandbox Code Playgroud)
要启用git协议,我使用以下命令运行另一个git-bash窗口.
git daemon --export-all --enable=receive-pack
Run Code Online (Sandbox Code Playgroud)
克隆它正确.基本上我想要c:/ repoclone/repo将是我的工作目录和更改我想在c:/ repo的裸存储库中推送.拉动似乎对我来说很好,但每当试图推送数据时,似乎保持处理没有任何错误.
一旦手动破坏守护进程命令,我得到了以下错误.
fatal: sha1 file '<stdout>' write error: Invalid argument
fatal: read error: Invalid argument
error: failed to push some refs to 'git://localhost/repo'
Run Code Online (Sandbox Code Playgroud)
任何的想法.
我已经在私人仓库工作了一段时间,我将发布给GitHub.
问题是我有很多提交,为了卫生,我只想在GitHub中出现一个提交.
如何在不推动历史的情况下推进?即将整个MASTER合并为一个提交
提前谢谢了.
道格
如果我有一个版本控制的主项目.
然后我为第三方插件添加了一个遥控器
git remote add myplugin <url>
那我可以做 git pull myplugin master
它只是从那个遥控器中拉出变化.
现在让我说我的项目设置为:
/
/index.php
/whatever
Run Code Online (Sandbox Code Playgroud)
并将遥控器设置为
/
/whatever.php
Run Code Online (Sandbox Code Playgroud)
当我拉入遥控器时,我最终会
/index.php
/whatever
/myplugin
/myplugin/whatever.php
Run Code Online (Sandbox Code Playgroud)
这很好.
我想知道的是,如果我对myplugin进行更改,
如果我发出git push myplugin master什么推?
它只会推动myplugin的变化吗?或远程作为第二个存储库并将提交整个存储库?
touch test
git add test
git commit -m "test"
git push -u origin master
Run Code Online (Sandbox Code Playgroud)
这很有效.该文件已上载到存储库.
rm test
cp -R ../website ./website
git rm test
git add website/
git commit -m "Initial"
git push -u origin master
Run Code Online (Sandbox Code Playgroud)
这没有给出任何输出,似乎没有对存储库做任何事情.测试文件仍存在于存储库中.
$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
Run Code Online (Sandbox Code Playgroud)
有人可以帮忙吗?
在客户端和服务器上重新创建分支,没有成功.当内部只有一个文件时,它可以工作,但它不会将网站文件夹推送到服务器.
这是我能看到的唯一奇怪的事情; POST git-receive-pack (chunked)
有没有办法告诉git将更改推送到github远程服务器更快一点.即使是在极小的rails应用程序中对少量文件进行微小更改,也需要更长的时间(约8-10秒).
我是BitBucket和SourceTree的新手,我尝试在SourceTree中使用Git将我的Rep推送到BitBucket,但它给了我这个错误:
conq: repository access denied. access via a deployment key is read-only.
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)
我通过公钥在BitBucket中设置了部署密钥,ssh密钥代理使用我的私钥运行.我有所有者访问权限.我想我错过了导致此错误的配置,有什么建议吗?
我正在将我的主分支推送到我的GIT仓库并发生此错误
fatal: 'master' does not appear to be a git repository
Run Code Online (Sandbox Code Playgroud)
根据我输入的堆栈问题的建议
git remote -v
Run Code Online (Sandbox Code Playgroud)
得到了
heroku https://git.heroku.com/peaceful-cove-8372.git (fetch)
heroku https://git.heroku.com/peaceful-cove-8372.git (push)
origin https://github.com/SimonWalsh1000/breathe.git (fetch)
origin https://github.com/SimonWalsh1000/breathe.git (push)
Run Code Online (Sandbox Code Playgroud)
然后我打字
simonalice$ git push -u origin master
Run Code Online (Sandbox Code Playgroud)
它有效,但说
Branch master set up to track remote branch master from origin.
Run Code Online (Sandbox Code Playgroud)
我对GIT很新,我不完全确定发生了什么.如果有人能向我解释这个序列,我将非常感激.我一直无法得到明确的答案.现在是我的主分支,GIT中的主分支还是一些克隆?
非常感谢
我正在使用MAC OS Yosemite,我想将一个17 MB的文件推送到我的github-Account。我在ssh和https上都尝试了git,但都没有用。
GIT_TRACE=1 GIT_CURL_VERBOSE=1 git push -u origin master返回最后6行:
Counting objects: 243, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (118/118), done.
packet_write_wait: Connection to 192.30.253.113 port 22: Broken pipe
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)
在寻找解决方案时,我开始在各种配置脚本中设置TCPKeepAlive,ServerAlive,ClientAlive参数,最后以~/.ssh/config:
Host github.com
PubKeyAuthentication yes
IdentityFile ~/.ssh/id_rsa.pub
ServerAliveInterval 300
TCPKeepAlive no
#ServerAliveCountMax 2400
Run Code Online (Sandbox Code Playgroud)
在/etc/sshd_config:
# $OpenBSD: sshd_config,v 1.89 2013/02/06 00:20:42 dtucker Exp $
# This is …Run Code Online (Sandbox Code Playgroud) 我创建了一个分支b1,并对它进行了一些更改,然后将其推送到远程存储库:
git branch b1
git checkout b1
git add newfile.txt
git commit -m "adding a new file"
git push origin b1
Run Code Online (Sandbox Code Playgroud)
在连接到远程存储库的另一台机器上,我尝试拉分支而不将其与master合并:
$git branch
*master
$git pull origin b1
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From sl*******02:/opt/git/projet1
* branch b1 -> FETCH_HEAD
Updating fca3b48..1d96ceb
Fast-forward
newfile.txt | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 …Run Code Online (Sandbox Code Playgroud)