Ubuntu 14.04搭建简单git服务器
/******************************************************************************
* Ubuntu 14.04搭建简单git服务器
* 说明:
* 由于最近需要搭建一下git服务器,记录一下一些疑虑和遇到的一些问题。
*
* 2016-6-7 深圳 南山平山村 曾剑锋
*****************************************************************************/ 一、参考文档:
. 搭建Git服务器
http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/00137583770360579bc4b458f044ce7afed3df579123eca000
. Git问题集锦
http://www.cnblogs.com/gsblog/p/3699209.html
. ssh: connect to host localhost port : Connection refused
http://blog.csdn.net/zlm_250/article/details/7979221
. Chapter Git on the Server
https://git-scm.com/book/en/v1/Git-on-the-Server 二、以下是等效推送,其他类似:
. 第一次推送:
git push git@192.168.1.9:/home/git/repos/sample.git master
git push git@192.168.1.9:repos/sample.git master
. 后续推送:
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.. 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: , done.
Writing objects: % (/), bytes | bytes/s, done.
Total (delta ), reused (delta )
To git@192.168.1.9:/home/git/repos/sample.git
* [new branch] master -> master
Ubuntu 14.04搭建简单git服务器的更多相关文章
- Ubuntu 16.04搭建原始Git服务器
说明:不要把有限的生命浪费到权限斗争中! 1.安装SSH sudo apt-get install openssh-server sudo service ssh start 2.安装Git sudo ...
- 翻译:在Ubuntu 14.04上安装FTP服务器的方法
说明: 1.原文地址:http://www.krizna.com/ubuntu/setup-ftp-server-on-ubuntu-14-04-vsftpd/ 2.今天要做一个网络日志的迁移程序,搬 ...
- 烂泥:ubuntu 14.04搭建OpenVPN服务器
本文由秀依林枫提供友情赞助,首发于烂泥行天下 公司分部需要连接公司内部的服务器,但是该服务器只允许公司内部的网络访问. 为了解决这个问题,打算使用VPN.对于VPN以前使用最多的是PPTP这个解决方案 ...
- 从零开始配置Ubuntu 14.04&SSH&curl&Git&MongoDB&Node.js
从零开始配置Ubuntu 14.04 从零开始配置Ubuntu 14.04,记录配置服务的过程,安装组件如下: SSH curl Git MongoDB Node.js ... Ubuntu 安装 ...
- 在 Ubuntu 14.04 中配置 PXE 服务器
PXE(预启动执行环境Preboot Execution Environment)服务器允许用户从网络中启动 Linux 发行版并且可以不需要 Linux ISO 镜像就能同时在数百台 PC 中安装. ...
- 【openvpn】转载:烂泥:ubuntu 14.04搭建OpenVPN服务器
地址:http://www.cnblogs.com/ilanni/p/4681740.html (1)安装openVpn软件后.在openVpn的配置目录下添加配置文件: ca.crt client ...
- Ubuntu 14.04安装配置NFS服务器
(一)安装NFS服务器1.1-安装Ubuntu nfs服务器端: sudo apt-get install nfs-kernel-server 1.2-安装nfs的客户端: sudo apt-get ...
- ubuntu 14.04搭建PHP项目基本流程
首先准备需要安装东西的列表1.apache服务器,2.php,3.mysql,4.几个软件包的链接包,安装方式是以apt-get方式安装; 1.安装apache服务器: apt-get install ...
- Ubuntu 14.04 搭建 LNMP
LNMP(Linux-Nginx-MySQL-PHP)这四种软件的组合,可以成为一个免费.高效.扩展性强的网站服务系统. 一.操作步骤 1.安装Nginx sudo apt-get update su ...
随机推荐
- 游戏引擎网络开发者的 64 做与不做 | Part 1 | 客户端方面
摘要:纵观过去 10 年的游戏领域,单机向网络发展已成为一个非常大的趋势.然而,为游戏添加网络支持的过程中往往存在着大量挑战,这里将为大家揭示游戏引擎网络开发者的 64 个做与不做. [编者按]时下, ...
- RDLC报表BC4000错误
如果RDLC报表报 BC4000错误,那是因为在矩阵外上面添加了文本框的缘故,导致系统不能读到RDLC报表表体,告诉你报表没有定义: 解决办法: 把表头文字放入矩阵中.
- mysql 事务提交过程
打开binlog选项后,执行事务提交命令时,就会进入两阶段提交模式.两阶段提交分为prepare阶段和commit两个阶段.流程如下 :这里面涉及到两个重要的参数:innodb_flush_log_ ...
- 链表(c语言实现)--------------小练习
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_SIZE 100 #d ...
- POJ 2151 Check the difficulty of problems (概率dp)
题意:给出m.t.n,接着给出t行m列,表示第i个队伍解决第j题的概率. 现在让你求:每个队伍都至少解出1题,且解出题目最多的队伍至少要解出n道题的概率是多少? 思路:求补集. 即所有队伍都解出题目的 ...
- POJ 2185 Milking Grid (KMP,求最小覆盖子矩阵,好题)
题意:给出一个大矩阵,求最小覆盖矩阵,大矩阵可由这个小矩阵拼成.(就如同拼磁砖,允许最后有残缺) 正确解法的参考链接:http://poj.org/showmessage?message_id=153 ...
- Android中 ListView 详解(二)
本文版权归 csdn noTice501 所有,转载请详细标明原作者及出处,以示尊重! 作者:noTice501 原文:http://blog.csdn.net/notice520/article/d ...
- AutoCompleteTextView的应用
现在我们上网几乎都会用百度或者谷歌搜索信息,当我们在输入框里输入一两个字后,就会自动提示我们想要的信息,这种效果在Android 里是如何实现的呢? 事实上,Android 的AutoComplete ...
- hdu 4023 Game 博弈论
思路: 将15种分成5类: 1.1和2为一类: 2.3,4,5,6为一类: 3.7,8,9,10为一类: 4.11,12,13,14,15为一类: 5.15为一类. 比较各类的优先级,就会发现放置的顺 ...
- log4net 一分钟上手
1. 首先从apache网站下载log4net, http://logging.apache.org/log4net/download_log4net.cgi .我下的是最新版本 log4net- ...