导航:首页 > IDC知识 > 阿里git服务器搭建

阿里git服务器搭建

发布时间:2020-11-06 22:51:03

1、求助关于在阿里云上执行git clone的问题

使用方法就是git clone 然后加你的地址就好了呀,如果你拉取国外源码的时候特别慢那么你也不用惊讶,因为阿里云使用的是电信出口,电信出口那情况肯定是众所周知的慢。。。

2、阿里云服务器 怎么用git部署代码

使用阿里云Ubuntu 12.0.4 64位操作系统做git服务器。
首先git服务器有两种访问方式可以选择:http方式和ssh的方式,http方式更容易使用。
1、http方式的git服务器搭建以及使用git命令行访问:
On the Server
1) Install Ubuntu Server, this is the base of our git server obviously
2) Now we need to install a couple of packages, these being ‘git-core’ and ‘apache2′, we do this like so:-
apt-get update
apt-get install apache2 git-core
3) Now we need to create a new folder for your new repository and set some inital permissons, we do this like so:-
cd /var/www
mkdir test-repo.git
cd test-repo.git
git --bare init
git update-server-info
chown -R www-data.www-data .
4) We now need to enable WebDAV on Apache2 of which we will use to serve the repository:-
a2enmod dav_fs
5) We now need to configure the access restrictions to our repository by creating the following file:-
/etc/apache2/conf.d/git.conf
Then fill it in with the following content:-
<Location /test-repo.git>
DAV on
AuthType Basic
AuthName "Git"
AuthUserFile /etc/apache2/passwd.git
Require valid-user
</Location>
Then save and close the file, lets move on to the next bit..
6) Next we need to create a user account of which you will need to use to browse of commit to the repository..
htpasswd -c /etc/apache2/passwd.git <user>
You could then be prompted to enter the password for the user too and confirm it!
7) Ok that’s it for the server side configuration… we just need to restart Apache2 like so and then we should be ready to move on to the client side stuff!
/etc/init.d/apache2 restart
…you can now move on to the client side stuff!
On the client side
Ok so now we need to create a local (on your desktop machine) repository and then we’ll initiate the new remote repository… So, if your using Linux/MacOSX bring up the terminal and type the following commands:-
mkdir ~/Desktop/test-project
cd ~/Desktop/test-project
git init
git remote add origin http://<user>@<server name or IP address>/test-project.git
touch README
git add .
git commit -a -m “Initial import”
git push origin master
Done! – Your intiial file named ‘README’ which currently is just blank has now been committed and you’ve pushed your code to your new git server which has now completed the Git reposity creation process, now in future you can ‘clone’ your resposity like so:-
git clone <user>@<server name or IP address>/test-project.git

注意上面连接http://<user>@<server name or IP address>/test-project.git中的user就是你htpasswd -c /etc/apache2/passwd.git <user>输入的用户名。
另外新建仓库的时候,只需执行:
cd /var/www
mkdir 项目名
cd 项目名
git --bare init
git update-server-info
chown -R www-data.www-data .
然后在/etc/apache2/conf.d/git.conf中对应添加上面类似段即可。
其中:
AuthUserFile 密码文件名
后面的文件就是你指定的密码文件,你可以
htpasswd -c 密码文件名 <user>
对应指定该项目的用户名和密码即可。添加用户是不要-c参数:
htpasswd 密码文件名 <user>

3、怎么在阿里云服务器搭建gitlab

和本地搭建一样的,我之前也搭建过

虽然整个搭建过程无比之艰辛,几乎占用了我一天的时间,但是最后搭好了,还是很开心滴。最后,如果你买的是512M的乞丐版阿里云,建议一定要升级至1024M内存,同时创建sawpfile,大小1G就够了,否则跑不动就只能呵呵了。

4、阿里云的服务器安装Gitlab有成功的吗

这个没有试过,应当可以吧。。

5、如何访问GitLab默认安装的PostgreSQL数据库

将GitLab的数据库导入阿里云PostgreSQL RDS
GitLab的数据库用的是PostgreSQL,之前由于阿里云RDS不支持PostgreSQL,只能将GitLab的数据库部署在云服务器上。
6月1日得知阿里云推出了PostgreSQL RDS,于是立马将GitLab的数据库迁移至PostgreSQL RDS。
下面分享一下迁移的主要操作步骤:

1)在GitLab服务器上备份GitLab数据库
操作命令:
sudo gitlab-rake gitlab:backup:create SKIP=db

注:这个命令原本是只备份数据库,但实际运行时也会备份repositories,可以在完成数据库备份时,ctrl+C直接退出。
数据库备份成功后,会在 /var/opt/gitlab/backups/db 文件夹中看到 database.sql 文件,导入时只需将这个文件导入到阿里云RDS。
2)在阿里云RDS中创建GitLab的数据库帐户与数据库
在阿里云RDS控制台首页点击逗登录数据库地,进入idb.rds.aliyun.com,选择对应的PostgreSQL实例。
a)创建2个帐户:gitlab, gitlab-psql
b)创建gitlabhq_proction数据库,所有者为gitlab。
3) 在GitLab服务器上进行导入操作
a) cd /var/opt/gitlab/backups/db
b) psql -h [RDS实例网址] p 3433 -d gitlabhq_proction -U gitlab -f database.sql

6、怎么连接gitlab的数据库

将GitLab的数据库导入阿里云PostgreSQL RDS
GitLab的数据库用的是PostgreSQL,之前由于阿里云RDS不支持PostgreSQL,只能将GitLab的数据库部署在云服务器上。
6月1日得知阿里云推出了PostgreSQL RDS,于是立马将GitLab的数据库迁移至PostgreSQL RDS。
下面分享一下迁移的主要操作步骤:

1)在GitLab服务器上备份GitLab数据库
操作命令:
sudo gitlab-rake gitlab:backup:create SKIP=db

注:这个命令原本是只备份数据库,但实际运行时也会备份repositories,可以在完成数据库备份时,ctrl+C直接退出。
数据库备份成功后,会在 /var/opt/gitlab/backups/db 文件夹中看到 database.sql 文件,导入时只需将这个文件导入到阿里云RDS。
2)在阿里云RDS中创建GitLab的数据库帐户与数据库
在阿里云RDS控制台首页点击“登录数据库”,进入idb.rds.aliyun.com,选择对应的PostgreSQL实例。
a)创建2个帐户:gitlab, gitlab-psql
b)创建gitlabhq_proction数据库,所有者为gitlab。
3) 在GitLab服务器上进行导入操作
a) cd /var/opt/gitlab/backups/db
b) psql -h [RDS实例网址] p 3433 -d gitlabhq_proction -U gitlab -f database.sql

7、如何在阿里云linux服务器安装git

Gentoo: emerge gitCentos: yum install gitUbuntu: apt-get install gitDebian: apt-get install git其它:下载源代码包,然后编译安装,或版者用其它的包管理制。权

8、阿里云创建了git库 为什么地址无效

第一,抄下载并安装git 目前windows版本的git有几种实现,但我们选择msysgit发行版,这是目前做得兼容性最好的。 使用默认配置安装Git。这个不用多说,一路Next就可以,如果对各种选项不熟悉,建议使用默认配置,没问题的。

9、小公司搭建gitlab,应该选择哪一种阿里云服务器

只跑gitlab一个应用的话至少保证双核4G以上的配置。如果还想跑一跑别的应用的话,那么4核8G以上开始考虑吧。

10、怎么在阿里云上搭建git服务器

小鸟云服务器niaoyun实例创建好之后,您可以使用以下任意一种方式登录服务器:

远程桌面连接(,MSTSC):采用这种方式登录,请确保实例能访问公网。如果在创建实例时没有购买带宽,则不能使用远程桌面连接。

管理终端VNC:无论您在创建实例时是否购买了带宽,只要您本地有网页浏览器,都可以通过管理控制台的管理终端登录实例。

使用远程桌面连接(MSTSC)登录实例

打开开始菜单>远程桌面连接,或在开始菜单>搜索中输入mstsc。也可以使用快捷键Win+R来启动运行窗口,输入mstsc后回车启动远程桌面连接。

在远程桌面连接对话框中,输入实例的公网IP地址。单击显示选项。

输入用户名,如小鸟云默认为niaoyun。单击允许我保存凭据,然后单击连接。这样以后登录就不需要手动输入密码了。

与阿里git服务器搭建相关的知识