SourceTree环境的搭建
2015-10-22 15:59
281 查看
在mac os x上搭建sourceTree的版本控制环境,花了不少时间,仍有许多疑惑,现将自己现在知道的记录一下。
1.创建一个新的git 服务器库,让同事们可以共享代码。具体搭建步骤按照“Git详解”系列文档进行。因为老大没有给我放开所有的权限,故我没有办法设置ssh、http以及git协议。但NFS可以帮助我创建一个新的库。
(1).打开sourceTree,创建本地仓库。不过本地路径你需要通过nfs选择服务器的存储路径。
(2).创建好新的裸仓库,再将服务器的git仓库克隆到本地的工作目录。
(3).接下来可以将代码拷贝到工作目录了,然后就是commit。在提交的过程中,我遇到如下问题:
(4).能够提交了,但是又出现如下错误“[remote rejected] master -> master (branch is currently checked out)”
错误原型如下:
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
[remote rejected] master -> master (branch is currently checked out)
。。。。。。
error: failed to push some refs to 'git@192.168.1.X:/var/git.server/.../web'
百度了下,有网友遇到过这个问题,原来是因为git默认拒绝了push操作,需要进行设置,修改.git/config文件后面添加如下代码:结果终于成功提交,并且从其他电脑成功克隆到本地。
[receive]
denyCurrentBranch = ignore
1.创建一个新的git 服务器库,让同事们可以共享代码。具体搭建步骤按照“Git详解”系列文档进行。因为老大没有给我放开所有的权限,故我没有办法设置ssh、http以及git协议。但NFS可以帮助我创建一个新的库。
(1).打开sourceTree,创建本地仓库。不过本地路径你需要通过nfs选择服务器的存储路径。
(2).创建好新的裸仓库,再将服务器的git仓库克隆到本地的工作目录。
(3).接下来可以将代码拷贝到工作目录了,然后就是commit。在提交的过程中,我遇到如下问题:
*提交的时候需要提供“全名”和“邮箱信息”,试了好几个都不是,有点晕,上网查询了下也没用,结果在设置里看到了用户和邮箱的信息。
并且需要取消勾选“使用所有仓库的这些细节”。(4).能够提交了,但是又出现如下错误“[remote rejected] master -> master (branch is currently checked out)”
错误原型如下:
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
[remote rejected] master -> master (branch is currently checked out)
。。。。。。
error: failed to push some refs to 'git@192.168.1.X:/var/git.server/.../web'
百度了下,有网友遇到过这个问题,原来是因为git默认拒绝了push操作,需要进行设置,修改.git/config文件后面添加如下代码:结果终于成功提交,并且从其他电脑成功克隆到本地。
[receive]
denyCurrentBranch = ignore
相关文章推荐
- 程序员书单_HTML篇
- 协议[I2C]_I2C子系统之I2C bus初始化——I2C_init()
- 阿里巴巴FastJson解析Json
- Web程序安全机制
- 项目开发--------推送的实现
- android开发过程中R.java无法生成问题的解决办法
- HDU_5504 GT and sequence
- Chromium for windows (2015)
- python学习笔记
- MFC右键菜单的使用
- HDOJ 1064Financial Management
- 程序员书单_java专项进阶篇
- 协议[I2C]_I2C子系统之内核中I2C子系统的结构
- HDU_5504 GT and sequence
- 使用boilerplate模版创建解决方案
- Python简介
- CentOS上subversion的安装与卸载
- 航天母舰
- Android密码明文密文切换
- hdu 2665(划分树)