我使用gitosis来托管我的GIT存储库。
我希望阻止管理员以外的用户(由提交者的电子邮件标识)将更新推送到子模块。
我尝试通过预接收钩子来查看是否可以读取子模块更改的列表,但由于是一个纯repo,它无法读取.gitmodules。
#!/bin/bash
OLDREV=$1
NEWREV=$2
unset GIT_DIR
unset GIT_WORKING_TREE
SUBS=$(git show $NEWREV:.gitmodules | sed -n "s/^.*git@repo://p")
for submod in SUBS
do
echo $su
几天来,我一直在与git身份验证(TFS)的问题作斗争。我使用VSTS (来自TFS的git)和Jenkins。我已经在jenkins git插件中设置了正确的凭据。项目在构建期间被成功克隆,但在推送之后(使用相同的凭据),我得到:
fatal: Authentication failed for (url of team project)
我也尝试过从管道推送提交(没有jenkins凭证管理器):
https://username:password@xxxxx.com/xxxxx/_git/xxxx
并使用个人访问令牌:
https://username:PAT@xxxxx.com/xxx
几天前我创建了一个分支并做出了承诺。在提交之后,我做了一些小的更改,所以我只是在做git commit --amend。然而,当我推到远程分支时,它在tip of your current branch is behind its remote counterpart中失败了。在开始提交之前,我确实运行了git pull。我想我可以做一个git push --force-with-lease来启动它,但是我想弄清楚为什么git推送不能独立工作。
git log $branchname: commit 79c6414 commit db3812b Merge: b50a40d 44768b2 c
我只更改了两个文件,它们是我想要推送到Github的唯一文件。我已经添加了我想要的两个文件,并提交了带有注释的更改。然而,当我推送时,我得到了以下结果:
git push
To github.com:TinsleyBridgeGroup/TBL-bending-presses.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:TinsleyBridgeGroup/TBL-bending-presses.git
您只能以编程方式编辑最后一条提交消息:
git commit --amend -m 'xxxxxxx'
或者以交互方式随机提交:
git rebase -i HEAD~n
# Vim opens up, select the commit you want to modify, and change the word "pick" for "edit"
git commit --amend -m "Changing an old commit message!"
git rebase --continue
如何将两者结合起来?我希
我对一个名为sandbox的分支进行了一些更改,并提交了这些更改,然后尝试将它们推送到沙箱的github版本。我收到了这条消息
To git@github.com:obromios/golf_mentor.git
! [rejected] sandbox -> sandbox (non-fast-forward)
error: failed to push some refs to 'git@github.com:obromios/golf_mentor.git'
hint: Updates were rejected because the tip of
我的本地存储库包含所有提交。最近,有人清除了远程存储库中的所有代码并提交了。现在,我想将本地代码推送到存储库中。
当我试图推送(git推送原始母版)时,我得到了错误。
(non-fast-forward)
error: failed to push some refs to 'https://myurl.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote change
我们正在使用TFS 2013与git源代码管理。我想强制执行一些规则,用于开始签入/提交消息格式。TFS不支持git服务器挂钩,所以我不得不通过实现ISubscriber接口来编写插件。
插件部分工作- git提交与消息不匹配的regex规则被拒绝在git推送。问题是-没有显示来自插件的自定义状态消息。只有通用信息:
! [remote rejected] master -> master (The reference was rejected by a plugin.)
error: failed to push some refs to 'http://repo_server