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

 

目录
打赏
0
0
0
0
12
分享
相关文章
超聚变服务器2288H V6使用 iBMC 安装 Ubuntu Server 24.04 LTS及后续系统配置
【11月更文挑战第15天】本文档详细介绍了如何使用iBMC在超聚变服务器2288H V6上安装Ubuntu Server 24.04 LTS,包括连接iBMC管理口、登录iBMC管理界面、配置RAID、安装系统以及后续系统配置等步骤。
609 4
ubuntu/debian shell 脚本自动配置 gitea git 仓库
这是一个自动配置 Gitea Git 仓库的 Shell 脚本,支持 Ubuntu 20+ 和 Debian 12+ 系统。脚本会创建必要的目录、下载并安装 Gitea,创建 Gitea 用户和服务,确保 Gitea 在系统启动时自动运行。用户可以选择从官方或小绿叶技术博客下载安装包。
147 2
Ubuntu16.04搭建gitlab服务器,搭建pip源服务器(两种方式),搭建apt源服务器
这篇文章是关于如何在Ubuntu 16.04系统上搭建GitLab服务器、pip源服务器(使用pypiserver和NGINX两种方式),以及apt源服务器的详细教程。
89 0
Ubuntu16.04搭建gitlab服务器,搭建pip源服务器(两种方式),搭建apt源服务器
大数据-39 Redis 高并发分布式缓存 Ubuntu源码编译安装 云服务器 启动并测试 redis-server redis-cli
大数据-39 Redis 高并发分布式缓存 Ubuntu源码编译安装 云服务器 启动并测试 redis-server redis-cli
87 3
|
5月前
|
Chat-TTS chat-tts-ui 实机部署上手测试!Ubuntu服务器实机 2070Super*2 8GB部署全流程
Chat-TTS chat-tts-ui 实机部署上手测试!Ubuntu服务器实机 2070Super*2 8GB部署全流程
129 1
Ubuntu18 服务器 更新升级CUDA版本 pyenv nvidia ubuntu1804 原11.2升级到PyTorch要求12.1 全过程详细记录 apt update
Ubuntu18 服务器 更新升级CUDA版本 pyenv nvidia ubuntu1804 原11.2升级到PyTorch要求12.1 全过程详细记录 apt update
202 0
|
11天前
|
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
通过本文,我们详细了解了 `yum`、`rpm`、`apt-get`和 `wget`的区别、常用命令以及在CentOS和Ubuntu中安装 `wget`的方法。`yum`和 `apt-get`是高层次的包管理器,分别用于RPM系和Debian系发行版,能够自动解决依赖问题;而 `rpm`是低层次的包管理工具,适合处理单个包;`wget`则是一个功能强大的下载工具,适用于各种下载任务。在实际使用中,根据系统类型和任务需求选择合适的工具,可以大大提高工作效率和系统管理的便利性。
75 25
ubuntu22 编译安装docker,和docker容器方式安装 deepseek
本脚本适用于Ubuntu 22.04,主要功能包括编译安装Docker和安装DeepSeek模型。首先通过Apt源配置安装Docker,确保网络稳定(建议使用VPN)。接着下载并配置Docker二进制文件,创建Docker用户组并设置守护进程。随后拉取Debian 12镜像,安装系统必备工具,配置Ollama模型管理器,并最终部署和运行DeepSeek模型,提供API接口进行交互测试。
301 15
OS-Copilot-ubuntu镜像版本的具体测试使用(安装方式有单独注明)
作为一名个人开发者,我主要负责云资源的运维和管理。在使用OS Copilot的过程中,我遇到了一些配置问题,特别是在ECS实例中设置AccessKey时,但最终成功解决了。通过使用OS Copilot的-t/-f/管道功能,我大大提升了效率,减少了命令编写的工作量,特别是在搭建Java运行环境时效果显著。此外,| 功能帮助我快速理解文档,整体体验非常流畅,推荐给其他开发者使用。
51 6
Ubuntu24.04安装Librenms
此指南介绍了在Linux系统上安装和配置LibreNMS网络监控系统的步骤。主要内容包括:安装所需软件包、创建用户、克隆LibreNMS仓库、设置文件权限、安装PHP依赖、配置时区、设置MariaDB数据库、调整PHP-FPM与Nginx配置、配置SNMP及防火墙、启用命令补全、设置Cron任务和日志配置,最后通过网页完成安装。整个过程确保LibreNMS能稳定运行并提供有效的网络监控功能。
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等