Ubuntu 14.04搭建简单git服务器

简介: /****************************************************************************** * Ubuntu 14.04搭建简单git服务器 * 说明: * 由于最近需要搭建一下git服务器,记录一下一些疑虑和遇到的一些问题。
/******************************************************************************
 *                     Ubuntu 14.04搭建简单git服务器
 * 说明:
 *     由于最近需要搭建一下git服务器,记录一下一些疑虑和遇到的一些问题。
 *
 *                                          2016-6-7 深圳 南山平山村 曾剑锋
 *****************************************************************************/

一、参考文档:
    1. 搭建Git服务器
        http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/00137583770360579bc4b458f044ce7afed3df579123eca000
    2. Git问题集锦
        http://www.cnblogs.com/gsblog/p/3699209.html
    3. ssh: connect to host localhost port 22: Connection refused 
        http://blog.csdn.net/zlm_250/article/details/7979221
    4. Chapter 4 Git on the Server
        https://git-scm.com/book/en/v1/Git-on-the-Server

二、以下是等效推送,其他类似:
    1. 第一次推送:
        git push git@192.168.1.9:/home/git/repos/sample.git master
        git push git@192.168.1.9:repos/sample.git master
    2. 后续推送:
        git push git@192.168.1.9:/home/git/repos/sample.git
        git push git@192.168.1.9:repos/sample.git

三、为什么在仓库里看不到源代码:
    A remote repository is generally a bare repository — a Git repository that has no working directory. Because the repository is only used as a collaboration point, there is no reason to have a snapshot checked out on disk; it’s just the Git data. In the simplest terms, a bare repository is the contents of your project’s .git directory and nothing else.
    一个远程仓库一般是一个纯仓库,一个git仓库没有工作目录。由于仓库仅仅用于收集节点,所以没有必要保留快照,所以仓库只保留git数据。因此,一个纯仓库只包含项目下的.git目录。

四、出现的问题:
    git@zengjf:~/testforrepos/sample$ git push git@192.168.1.9:/home/git/repos/sample.git
    warning: push.default is unset; its implicit value is changing in
    Git 2.0 from 'matching' to 'simple'. To squelch this message
    and maintain the current behavior after the default changes, use:

      git config --global push.default matching

    To squelch this message and adopt the new behavior now, use:

      git config --global push.default simple

    When push.default is set to 'matching', git will push local branches
    to the remote branches that already exist with the same name.

    In Git 2.0, Git will default to the more conservative 'simple'
    behavior, which only pushes the current branch to the corresponding
    remote branch that 'git pull' uses to update the current branch.

    See 'git help config' and search for 'push.default' for further information.
    (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
    'current' instead of 'simple' if you sometimes use older versions of Git)

    No refs in common and none specified; doing nothing.
    Perhaps you should specify a branch such as 'master'.
    fatal: The remote end hung up unexpectedly
    error: failed to push some refs to 'git@192.168.1.9:/home/git/repos/sample.git'
    git@zengjf:~/testforrepos/sample$ git push git@192.168.1.9:/home/git/repos/sample.git master
    Counting objects: 3, done.
    Writing objects: 100% (3/3), 243 bytes | 0 bytes/s, done.
    Total 3 (delta 0), reused 0 (delta 0)
    To git@192.168.1.9:/home/git/repos/sample.git
     * [new branch]      master -> master

 

目录
相关文章
|
4月前
|
Ubuntu Linux 网络安全
Linux服务器之Ubuntu的安装与配置
Ubuntu Desktop是目前最成功、最流行的图形界面的Linux发行版;而Ubuntu Server也在服务器端市场占据了较大的份额。今天为大家详细介绍了Ubuntu Server的安装与配置,希望对你能有所帮助。关于VMware、VirtualBox等虚拟化软件的使用,朱哥还会在后续的文章中为大家详细介绍,敬请关注!
|
2月前
|
Shell Linux 网络安全
宝塔服务器面板部署安装git通过第三方应用安装收费怎么办—bash: git: command not found解决方案-优雅草卓伊凡
宝塔服务器面板部署安装git通过第三方应用安装收费怎么办—bash: git: command not found解决方案-优雅草卓伊凡
427 3
宝塔服务器面板部署安装git通过第三方应用安装收费怎么办—bash: git: command not found解决方案-优雅草卓伊凡
|
3月前
|
Ubuntu 安全 应用服务中间件
详细指南:配置Nginx服务器在Ubuntu平台上
以上步骤涵盖了基本流程:从软件包管理器获取 Ngnix, 设置系统服务, 调整UFW规则, 创建并激活服务器块(也称作虚拟主机), 并进行了初步优化与加固措施。这些操作都是建立在命令行界面上,并假设用户具有必要权限(通常是root用户)来执行这些命令。每个操作都有其特定原因:例如,设置开机启动确保了即使重启后也能自动运行 Ngnix;而编辑server block则定义了如何处理进入特定域名请求等等。
272 18
|
3月前
|
Ubuntu 安全 关系型数据库
安装MariaDB服务器流程介绍在Ubuntu 22.04系统上
至此, 您已经在 Ubuntu 22.04 系统上成功地完成了 MariadB 的标准部署流程,并且对其进行基础但重要地初步配置加固工作。通过以上简洁明快且实用性强大地操作流程, 您现在拥有一个待定制与使用地强大 SQL 数据库管理系统。
239 18
|
3月前
|
Ubuntu 安全 应用服务中间件
详细指南:配置Nginx服务器在Ubuntu平台上
以上步骤涵盖了基本流程:从软件包管理器获取 Ngnix, 设置系统服务, 调整UFW规则, 创建并激活服务器块(也称作虚拟主机), 并进行了初步优化与加固措施。这些操作都是建立在命令行界面上,并假设用户具有必要权限(通常是root用户)来执行这些命令。每个操作都有其特定原因:例如,设置开机启动确保了即使重启后也能自动运行 Ngnix;而编辑server block则定义了如何处理进入特定域名请求等等。
339 17
|
3月前
|
Ubuntu 安全 关系型数据库
安装MariaDB服务器流程介绍在Ubuntu 22.04系统上
至此, 您已经在 Ubuntu 22.04 系统上成功地完成了 MariadB 的标准部署流程,并且对其进行基础但重要地初步配置加固工作。通过以上简洁明快且实用性强大地操作流程, 您现在拥有一个待定制与使用地强大 SQL 数据库管理系统。
265 15
|
4月前
|
编解码 缓存 Ubuntu
在Ubuntu平台搭建RTMP直播服务器使用SRS简要指南
这个简要指南提供了搭建基本 RTMP 直播服务所需知道信息. SRS 还提供许多高级特性如 DVR、转码、边缘缓存等. 若要利用这些特性, 需要进一步阅读官方文档并相应地调整配置文件.
416 0
|
6月前
|
网络协议 Ubuntu
在Ubuntu 18.04/20.04 LTS设置静态DNS服务器的过程。
以上步骤提供了一种简洁明了的指导,让用户能够在Ubuntu系统中有效设置静态DNS服务器,这对日常管理和网络配置来说是非常实用的技能。
578 18
|
4月前
|
Ubuntu 网络安全 PHP
如何使用vscode的Docker插件管理ubuntu 拉取服务器的镜像以及创建容器
本测试镜像旨在记录使用vscode的Docker插件拉取病创建Dockerfile,以及拉取镜像。
|
4月前
|
Ubuntu Linux
如何在 Ubuntu 服务器上安装桌面环境(GUI)
如果你有任何问题,请在评论区留言。你会在服务器上使用 GUI 吗?参照本文后你遇到了什么问题吗?
506 0

热门文章

最新文章