我最近在我的服务器上安装了 GitLab 和 nginx。一切顺利,但是,我在server_names_hash_bucket_size& 中遇到了问题server_names_hash_max_size。我需要增加它,但后来我对 nginx 文档感到困惑。我不知道把包含这两个的 http {} 放在哪里。我的配置如下:
http {
server_names_hash_bucket_size 64;
server_names_hash_max_size 512;
}
server {
listen *:80; # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea
server_name gitkeeper.adtaco.com; # e.g., server_name source.example.com;
server_tokens off; # don't show the version number, a security best practice
root /home/git/gitlab/public;
# individual nginx logs for this gitlab vhost
access_log /var/log/nginx/gitlab_access.log;
error_log /var/log/nginx/gitlab_error.log;
location / {
# serve static files from defined root folder;. …Run Code Online (Sandbox Code Playgroud) 我试图让 Jenkins 使用 Git 作为我们的 SCM,并且设置它有点痛苦。
指定要使用的 Codebase Git 存储库时,请使用以下格式:
https://our.domain.com/repository/repository.git
Run Code Online (Sandbox Code Playgroud)
我从詹金斯收到以下错误:
Failed to connect to repository : Failed to connect to https://our.domain.com/repository/repository.git (status = 401)
Run Code Online (Sandbox Code Playgroud)
该存储库是私有的,我不确定如何为其配置用户帐户。我在我的 Ubuntu 服务器上为 Jenkins 用户生成了一个 RSA SSH 密钥,并将其作为部署密钥添加到代码库中。
我不断收到 404 错误?
另外,如果我尝试
git@codebasehq.com:.../repository.git
Run Code Online (Sandbox Code Playgroud)
格式,我只是从 Jenkins 得到一个不同的错误:
Failed to connect to repository : Command "ls-remote -h git@codebasehq.com:.../repository.git HEAD" returned status code 128:
stdout:
stderr: Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and …Run Code Online (Sandbox Code Playgroud) 我正在尝试运行这个命令:
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch filename.js' --prune-empty --tag-name-filter cat -- --all
Run Code Online (Sandbox Code Playgroud)
但我不断收到此错误:
fatal: ambiguous argument 'rm': unknown revision or path not in the working tree
.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Run Code Online (Sandbox Code Playgroud) 我有一个设置,可以从我的本地计算机 ssh 到我的远程服务器(即 Google 计算实例)。我曾经能够从远程实例上的存储库进行克隆、推送和拉取,而无需向远程实例添加任何密钥,也无需向在线存储库添加任何新密钥(只需本地计算机中的公钥)。我相信远程实例正在使用本地的密钥来验证我的 Git 推送和拉取操作。
然而,当我在本地计算机上重新安装操作系统时,系统崩溃了。现在,当我尝试从远程实例连接 Github 服务器时,我得到以下信息:
无法克隆:
[lucas@ecoinstance]~/node$ git clone git@github.com:lucasExample/test.git test
Cloning into 'test'...
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)
无法推送:
[lucas@ecoinstance]~/node/nodetest1$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
[lucas@ecoinstance]~/node/nodetest1$ git push
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)
附加信息:
[lucas@ecoinstance]~/node/nodetest1$ ssh-add -l
Could …Run Code Online (Sandbox Code Playgroud) 您可以使用像 Git 这样的 VCS 来跟踪对 VirtualBox 磁盘的更改吗?如果不是,在配置虚拟服务器时使用版本控制来跟踪更改的好方法是什么。
**我知道 git 不能很好地跟踪二进制 blob。
我想挂载 VirtualBox 驱动器并从根跟踪更改。我唯一需要担心二进制 blob 的时间是初始 git commit 和我更新软件后的任何 git commit。
configuration virtual-machines virtualbox version-control git
好奇哪个源代码库在使用服务器资源方面更有效,git 还是 svn?
我的团队正在使用几台 RedHat Linux 服务器,我们希望将我们的源从一台服务器同步到另一台服务器(针对几个不同的项目)。
我想设置一个 git-server 作为版本控制;但是我是 git 的新手,我对术语(“服务器”、“守护进程”、“存储库”等)感到困惑。此外,我们在防火墙后面工作。
谁能给我一个关于如何设置 git 服务器的链接?
谢谢,
皮埃尔
更新:我发现的最佳资源是http://blog.commonthread.com/2008/4/14/setting-up-a-git-server但是,例如,我如何“使用 ssh 密钥登录,以便您可以拥有多个开发人员安全轻松地连接”
我想在我的项目中 git ignore 缓存目录。我在互联网上读到我应该使用 gitignore 命令。但是当我这样做时,bash 抱怨命令不存在。我尝试运行一个apt-get install gitignore,但包不存在。
我如何告诉 git 忽略我的缓存目录?
考虑一个具有用户只读权限的文件,例如......
-r--------+ admin secrets.txt
Run Code Online (Sandbox Code Playgroud)
如何将这样的文件置于修订控制之下,以使其内容保密,即使是修订控制管理员也不知道?
为使用 git 部署到服务器的生产 Web 服务器设置用户和权限的最佳方法是什么?
背景
运行Ubuntu 12.04,我有apache下提供文件服务/var/www的www-data。我还在根用户目录下有一个裸 git 存储库,可以/var/www/example.com在 post-receive 挂钩中结帐。
这工作得很好,但考虑到它是一个生产服务器,我想提高一些安全性并从 root 用户中删除 repo。所以我创建了一个 git 用户并在/home/git. 但是现在我遇到了一个用户拥有存储库而另一个用户拥有 Web 根的事实的权限问题。
我在网上阅读了很多论坛和教程。大多数似乎只使用 root 用户,其他人似乎有更严重的安全问题(例如www-data授予对 repo 的读取权限)。我正在从现实世界的经验中寻找见解,因为有很多方法可以做到这一点。
请注意,post-receive hook 不仅仅是结帐。它还执行一些构建过程,例如运行 Composer 和其他一些可能需要几分钟的 php 脚本。
我尝试了几种解决方案:
我尝试将 git 用户添加到www-data group,然后将 web 根目录重新添加到www-data钩子的末尾。这有两个问题。首先,我必须修改 sudoers 文件,我从中得到的结果是命中注定的。其次,在钩子运行的那几分钟内,检出的文件归 git 而不是www-data,因此站点上的用户可能会收到读取错误。
我尝试将 post-receive 的内容放在另一个文件中,并使用 sudo 执行它。同样,这需要编辑 sudoers 文件,以便 git 用户无需密码即可 sudo。
或者可能是将 repo 留在 root 用户下是较小的邪恶,而我做这一切都是徒劳的。
有没有我没有尝试过的更好的解决方案?
git ×10
apache-2.2 ×1
jenkins ×1
nginx ×1
perforce ×1
performance ×1
permissions ×1
public-key ×1
ssh ×1
ssh-keys ×1
sudo ×1
svn ×1
ubuntu ×1
vcs ×1
virtualbox ×1