How To: Install and Configure GitWeb

Debian 7 安装 Git 实战指南:apt-get 与源码编译双路径 Git 是分布式版本控制的核心工具,其基础原理依赖对象存储、快照机制与分支模型,在资源受限的老旧系统中尤为考验环境适配能力。Debian 7(Wheezy)作为冻结于2013年的稳定发行版,软件源已归档至 archive.debian.org,原生仅提供 git-core 而非 git 包,且默认缺失 build-essential 等关键编译依赖。这种‘时间胶囊’式生态决定了:直接套用现代教程极易因 apt-get update 失败、GPG 密钥过期、libc6 版本冲突或 ARM 架构不兼容而中断。本 阅读详情

http://gofedora.com/how-to-install-configure-gitweb/

Goal

Setting up gitweb (web interface for SCM software git) for your project’s git repository for public access and developer commits via ssh.

Assumptions
  1. You already have your project’s git repository.
  2. You have hosting space somewhere to host gitweb.
  3. You have root access.
  4. You are using Apache as webserver.
Example for this howto

Project : VideoCache
Domain for gitweb : git.cachevideos.com
URL for git access for videocache : http://git.cachevideos.com/videocache.git
Actual path on server : /home/saini/domains/cachevideos.com/git
Git repository : /home/saini/projects/videocache/

Installation

Installation is pretty easy. Just one single command would do everything.

[
root@
localhost ~]
# yum install gitweb (do as root)

This will create a directory /var/www/git which is default for gitweb.

Copy the directory /var/www/git/ to /home/saini/domains/cachevideos.com/git

[
root@
localhost ~]
# cp -r /var/www/git /home/saini/domains/cachevideos.com/git
Configuration

1. GitWeb

Open the file /etc/gitweb.conf (it may or may not be there) and add the following lines to it.

# Change This

$projectroot = '/home/saini/domains/cachevideos.com/git' ;
# Change This
$site_name = "Kulbir Saini's git trees." ;
# Don't Change the variables below
$my_uri = "/" ;
$home_link = '/' ;
@stylesheets = ( "/gitweb.css" ) ;
$favicon = "/git-favicon.png" ;
$logo = "/git-logo.png" ;

2. Apache

Open the file /etc/httpd/conf.d/git.conf and clear all the lines that are already there and add the following lines to it

  DocumentRoot /
home/
saini/
domains/
cachevideos.com/
git
ServerName git.cachevideos.com
ErrorLog "/home/saini/domains/cachevideos.com/logs/error_log"
CustomLog "/home/saini/domains/cachevideos.com/logs/access_log" combined
SetEnv GITWEB_CONFIG / etc/ gitweb.conf
DirectoryIndex gitweb.cgi
 
Allow from all
AllowOverride all
Order allow,deny
Options +ExecCGI
AddHandler cgi-script .cgi
 
SetHandler cgi-script
 
RewriteEngine on
RewriteRule ^[ a-zA-Z0-9 _/-] +/.git/ ?( /?.* ) ?$ / gitweb.cgi% { REQUEST_URI} [ L,PT]

3. Git repository configuration

Go to your git repository (/home/saini/projects/videocache/ ) and make the following changes.

(a). Open file .git/description and add a short nice description for your project.

videocache is a squid url rewriter plugin written in Python to facilitate youtube, metacafe, dailymotion, google, vimeo, msn soapbox, tvuol.uol.com.br, blip.tv, break.com videos and wrzuta.pl audio caching.

(b). Open file .git/config and append the following lines

[
gitweb]

owner = "Kulbir Saini"

Copy project’s git repository for gitweb

Copy the /home/saini/projects/videocache/.git directory to /home/saini/domains/cachevideos.com/git/videocache.git

[
root@
localhost ~]
# cp -r /home/saini/projects/videocache/.git /home/saini/domains/cachevideos.com/git/videocache.git
Finishing Step

Restart Apache webserver.

[
root@
localhost ~]
# service httpd restart

Now you can browser a list of your projects’ git repositories at http://git.cachevideos.com/ .

Adding another project repository

Just copy the project repository’s .git directory to /home/saini/domains/cachevideos.com/git/prjoect_name.git . And it’ll be shown on the list.

Committing (pushing) to the repository

For committing to the repository via ssh use the following command.

# Pushing everything (Please see the username)

[ root@ localhost videocache] # git push --all ssh://saini@git.cachevideos.com/~saini/domains/cachevideos.com/git/videocache.git

To update tags on the remote repository use this command.

# Pushing all tags

[ root@ localhost videocache] # git push --tags ssh://saini@git.cachevideos.com/~saini/domains/cachevideos.com/git/videocache.git

Well, if you consider just the web interface and committing part for your project, thats all. But things can be fine tuned further. Below are few hacks!

1. Enabling nice urls.

By default the urls for browsing repository via git web are pretty crappy and difficult to remember. The RewriteRule and RewriteEngine lines in your Apache configuration file (/etc/httpd/conf.d/git.conf ) takes care of that and produce nice and clean urls.

So you can browser the repository via http://git.cachevideos.com/videocache.git instead of http://git.cachevideos.com/?p=videocache.git;a=summary .

2. Enabling remote ls (git-ls-remote or git ls-remote)

This is the most trickiest part. If you try the command below, it won’t produce any output

[
root@
localhost ~]
# git-ls-remote http://git.cachevideos.com/videocache.git

You need to go to project’s repository in gitweb and then run the following command to update the server info for git.

[
root@
localhost ~]
# cd /home/saini/domains/cachevideos.com/git/videocache.git/

[ root@ localhost ~] # git-update-server-info

Try the ls-remote command now and it should succeed by producing all the branches and tags in the remote repository.

But there is a problem, you have to run the above command after every commit to the remote repository. To solve this issue, you can enable post-update hook for the project’s repository in gitweb. Use the following command to enable it.

[
root@
localhost ~]
# cd /home/saini/domains/cachevideos.com/git/videocache.git/

[ root@ localhost ~] # chmod +x post-update

The above command will update the server info automatically every time you commit.

Thats all you need to do for setting up gitweb. I hope this will be helpful.

STM32F103C8T6+TB6612驱动直流电机全攻略(附PWM调速代码) 本文提供了一份基于STM32F103C8T6微控制器和TB6612驱动模块的直流电机驱动完整解决方案。详细解析了硬件连接、STM32CubeMX配置、HAL库驱动代码编写,并附带了PWM调速代码实现。内容涵盖从基础原理到实战调试的全过程,旨在帮助开发者快速构建稳定、可精准调速的电机控制系统,适用于智能车、机器人等嵌入式项目。 阅读详情

相关推荐

别再凭感觉估算!用ADS的EBOND库精确仿真Bonding线寄生电感(附完整参数设置指南)

本文详细介绍了在ADS中使用EBOND库精确仿真Bonding线寄生电感的方法,帮助射频工程师在毫米波频段实现高精度建模。通过三维物理参数和电磁场求解算法,EBOND模型能将误差控制在5%以内,显著提升电路性能。文章还提供了完整的参数设置指南和实战操作步骤,适用于5G毫米波前端模块等高频应用场景。

weixin_28730131的博客 515

linux git web管理工具,玩转Linux(2)——搭建GitWeb

前言GitWeb 和GitLab相比,一个是简单的仓库查看器,一个是复杂的Git管理系统。之所以不安装GitLab而选择安装GitWeb的原因有以下:1、GitLab对配置要求很高GitLab是基于ruby的,此外还使用了Postgresql、redis等,启动的worker process很多,官方推荐至少需要2核4G。2、不需要特别多人,没有复杂的权限控制要求基本是一个“私服”,用来与Jenk...

weixin_33050117的博客 1187

MacBook用户必看:用Homebrew一键搞定frp内网穿透(含阿里云配置模板)

本文为MacBook用户提供基于Homebrew的frp内网穿透实战指南,详细介绍了从环境准备到阿里云服务器配置的全过程。通过Homebrew一键安装frp客户端,结合阿里云配置模板,实现高效稳定的内网穿透,适用于远程开发、IoT设备调试等多种场景。

weixin_28692817的博客 327

linux git同步web,在linux下搭建git服务器,并实现web目录同步更新

git作为php开发者常用的一款分布式版本控制系统,在工作中我们可能会遇到要自己搭建git服务器的情况,在此简单介绍下在linux系统下如何搭建git服务器,希望对大家有所帮助。1、安装gitLinux服务器端:#yum install -y git安装完后,查看 Git 版本[root@localhost~]#git--versiongitversion1.8.3.1Windows客户...

weixin_35618196的博客 479

嵌入式八股文-ARM

嵌入式八股文总结(ARM篇)-CSDN博客现象:I2C死锁就是时钟线SCL一直处于高电平,数据线SDA一直处于低电平。从机拉低数据线SDA时(发送应答信号给主机时或发送数据0时)主机意外复位,主机复位后时钟线SCL就为高电平了,此时,SCL为高电平而SDA为低电平,主机就以为有其他设备占有了总线,而SCL为高电平时 数据位SDA不允许有变化,意思是:主机就一直等待时钟线SDA拉高,而从机就一直等待时钟线SCL拉高 就造成了死锁的现象。解决方法:1.选择带有复位功能的从设备,复位后SDA被拉高。

m0_63127436的博客 1268

Gartner 2025 中国网络安全成熟度曲线深度解读:AI 安全如何重构防御逻辑

2025 年 Gartner 中国网络安全技术成熟度曲线的发布,标志着国内网络安全领域正式进入 “AI 原生防御” 时代。这份聚焦中国市场特性的报告清晰揭示:网络安全的核心命题已从 “防御 AI 驱动的攻击” 演进为 “保障 AI 系统自身安全与业务协同”,AI 安全技术正成为重构企业防御体系的核心引擎。

KKKlucifer的博客 1394

Linux下安装配置gitweb

安装配置gitweb 1. sudo  apt-get install gitweb 2. sudo  apt-get install apache2 3. mkdir  /home//gitweb 4. sudo ln -sf /usr/share/gitweb/*  /home//gitweb 5. ln -s /home//gitweb 6. sudo

liangpz521的技术资料库 1857

一个开源的AI数据分析工具,与数据对话,一键生成SQL、图表、表格、报告和智能商业分析。

Wren AI是一个开源的AI智能代理,让用户能够跟数据对话,实现从文本到SQL的转换,还能生成图表、电子表格、报告以及商业智能分析。它支持多种语言,能深入挖掘数据价值,提供智能数据探索功能,通过语义索引和精心设计的界面,让用户无需写代码即可获取洞察。Wren AI采用独特的架构,包含Wren UI、Wren AI Service和Wren Engine三大核心服务,可部署在本地或云端,助力团队高效、安全地解锁数据潜力。

AI_Charlotte的博客 4508

玩转Linux(2)——在自己的服务器上搭建Git私有仓库(GitWeb)

前言 GitWeb 和GitLab相比,一个是简单的仓库查看器,一个是复杂的Git管理系统。 之所以不安装GitLab而选择安装GitWeb的原因有以下: 1、GitLab对配置要求很高 GitLab是基于ruby的,此外还使用了Postgresql、redis等,启动的worker process很多,官方推荐至少需要2核4G。 2、不需要特别多人,没有复杂的权限控制要求 基本是一个“私服”,用...

衡与墨的博客 2106

OpenClaw进阶实战(十二):电商比价工作流(一)——数据采集与竞品监控

本文介绍了基于OpenClaw的电商比价系统实现方案。该系统可自动化监控淘宝、京东、拼多多等平台的竞品价格波动,包含以下核心功能: 多平台价格采集:通过各平台官方API(淘宝客、京东联盟、多多进宝)获取商品价格,并提供模拟数据模式便于测试 数据存储与分析:使用SQLite存储历史价格数据,支持查询最近价格和价格变化趋势 模块化设计:采用技能化架构,分离了平台适配层(淘宝/京东/拼多多)、数据存储层和核心业务逻辑 扩展性:预留了价格波动告警接口(钉钉通知),为后续动态调价提供数据支撑 系统特点: 支持真实AP

PeterPan的博客 217

【知识点讲解】大模型参数量与计算量(FLOPs)估算方法

指标参数量 (Params)计算量 (FLOPs)含义模型的大小,静态模型的计算复杂度,动态决定因素模型结构(宽度、深度)模型结构 +输入数据(B, S)影响内存占用、磁盘空间运行速度、能耗单位M (百万), B (十亿)工具thopptflopstorchinfothopptflopsfvcore重要提示FLOPs ≠ 速度:FLOPs 是理论计算量。实际速度还受内存带宽 (Memory Bandwidth)并行度硬件架构等因素严重影响。

AI浩 2107

linux git web管理工具,在Ubuntu下安装Web在线版本管理系统Gitweb

在Ubuntu操作系统环境中git服务端安装部署一个gitweb服务,并简单的进行测试。目前,要说最简单的网页版本管理系统就是gitweb了。下面就是gitweb最简单的安装和测试步骤。安装gitweb的前提(2)、服务器上已经安装Apache,并配置好CGI可用。(3)、本文在前面2个条件满足下,安装部署gitweb服务就非常简单了。1.安装gitweb程序系统终端中运行命令:sudo apt-...

weixin_31238109的博客 798

1553B总线介绍及其硬件方案设计

军用1553B总线 1.简介 简单介绍可参考(https://blog.csdn.net/ScilogyHunter/article/details/108444231)博主写的很详细。 1553B总线是MIL-STD-1553总线的简称,其中B就是BUS,MIL-STD-1553B总线是飞机内部时分制命令/响应式多路复用数据总线。1553B数据总线标准是20世纪70年代由美国公布的一种串行多路数据总线标准。1553B总线能挂31个远置终端,1553B总线采用指令/响应型通信协议,它有三种终端类型: BC:

小幽余生不加糖 1万+

[Linux]通过用户名和密码的方式搭建Git服务器(http&gitweb)

1、安装依赖 yum -y install perl cpio autoconf tk zlib-devel libcurl-devel openssl-devel expat-devel yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker cpan yum -y install epel-release ...

hsdllcw的博客 4570

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

linux以http方式搭建git服务器

linux以http方式搭建git服务器,即clone的方式为git clone http://xxxxxxxx。用到apache和git-core(支持git的CGI)1.安装httpdyum install httpd因为很多服务器本身就启动了80端口,所以修改监听端口:vi /etc/httpd/conf/httpd.conf // 找到 Listen 80修改为: Listen 8081...

CyborgLin的博客 8894

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

Bash Self-Extracting Script

Bash Self-Extracting Script

走南闯北的专栏 1232

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

Linux系统git服务端搭建和web项目的自动更新

服务器端 1.linux服务器上搭建 【centos】 yum install -y git 2.搭建完成后使用命令查看 git --version 3. 服务器端创建 git 用户,用来管理 Git 服务,并为 git 用户设置密码 请依次执行一下命令 4.服务器端创建 Git 仓库 设置 /home/data/git/gittest.git 为 Git 仓库 ...

逍遥游的博客 1941

linux下安装apache+gitweb

linux下安装apache+gitweb

huhuhuemail的博客 1762

在Linux上用Apache搭建Git服务器

最近在学Linux,终于在Linux上用Apache搭建起了Git服务器,在此记录一下。 服务器:阿里云服务器 Linux版本:CentOS 6.5 Apache版本:Apache/2.2.15 Git版本:git 1.7.1 Git访问方式:基于http的基本验证(非SSL) Apache的安装 1. 安装Apache软件:yum install httpd 2. 设置Apach...

weixin_34242509的博客 363

Linux系统下利用Git通过shell脚本自动部署Web项目

Linux系统下利用Git通过shell脚本自动部署Web项目

m0_52765511的博客 1131

git 可以清理从远程下载到本地的分支吗

只要你的命令是以。

yang1276的博客 225

git上传的时候,它这个版的提交,是否包括了以前的改动? 比如下面这个,它前面的一些改动,会自动因为f91285c70dde 提交而提交吗?

Git提交推送时,会自动包含目标提交及其所有祖先提交(即之前的改动),因为Git的提交是链式结构。你执行 git push github f91285c70dde:refs/heads/main 时,不仅推送了该提交,还一并推送了从历史起点到该提交之间的所有改动。远程分支更新为 f91285c,说明中间所有提交均已同步。只要这些改动在提交链上,就必然被上传,无法单独跳过。

skywalk8163的专栏 162

2027年地理信息技术与遥感测绘国际会议(GITRSM 2027)

2027年地理信息技术与遥感测绘国际会议(GITRSM 2027)将在西安召开。会议聚焦地理信息系统、遥感技术、测绘技术以及空间数据应用等领域,旨在为科研人员和行业专家提供交流创新方法与实践经验的平台。

Yangxshy的博客 207

Git 基础篇(一):基本介绍与安装

本文介绍了Git的基本概念、分布式版本控制原理及安装配置流程。阐述了版本控制的必要性,讲解了Git作为分布式系统的特点与优势,并区分了Git与GitHub的关系。文章详细说明了Git的工作流程(工作区、暂存区、本地与远程仓库),指导用户在Windows、Linux、macOS上安装Git,验证安装后进行用户名与邮箱的全局配置,为后续开发协作奠定基础。

Felix_kiss_L的博客 1179

ROS2从入门到精通(18)

本文介绍了ROS2开发环境配置中Ubuntu下Git的安装与使用。Git作为分布式版本控制系统,具备离线操作、高效分支管理、数据完整性保障及跨平台兼容等优势。文中厘清了Git、GitHub与Gitee的关系:Git是工具,后者为基于Git的代码托管平台。通过sudo apt install git命令可快速完成安装,为后续ROS2开发奠定基础。

phmatthaus的专栏 342

Git 深入理解(一) | 核心概念

Git 是分布式版本控制系统。多数教程从命令讲起,但命令只是表象;先建立正确的心智模型,才能预判命令的行为,而不是死记参数。Git 从来不是为“保存文件”而生的,它是为“管理变化”而设计的。因此它记录的不是“这次改了哪几行”,而是“每次提交之后,项目是什么样子”。《Pro Git》用一句话概括了这个模型:—— 项目历史,是一系列微型文件系统的快照。Git 和其它版本控制系统(包括 Subversion 和近似工具)的主要差别,在于 Git 对待数据的方式。

日常学习记录 340
上一篇: Install Gitweb in fedora12
下一篇: [SVN]-How do I relocate a repository to another host?
sanlinux
博客等级 码龄17年 92粉丝 158原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址