git - 如何在没有互联网连接的情况下在 ubuntu 上提取 git 存储库?

标签 git ubuntu offline git-pull

我想在我们公司的本地网络上使用 Git,因为我的计算机无法访问 Internet。我的 friend 有互联网连接和一台 ubuntu 机器,他将一些源代码推送到 Git,我需要在没有互联网连接的情况下 pull 它们,我也使用 ubuntu 14.04。
另外,我使用以下命令设置了一个存储库:

git init --bare

编辑:两台机器都是ubuntu,很抱歉造成误解。

最佳答案

请您的 friend 为 git 存储库创建一个 Windows 共享。

确保您已安装

apt-get install cifs-utils

创建挂载目录
$ mkdir ~/my_friends_repo

使用挂载远程共享
$ sudo mount -t cifs -o username=USERNAME,password=PASSWORD \
      //your_friends_ip_or_computer_name/NAME_OF_SHARE ~/my_friends_repo

现在你可以克隆它
git clone ~/my_friends_repo my_friends_repo_clone

或将其作为另一个远程存储库添加到您现有的存储库中并提取他的更改
git remote add my_friends_repo ~/my_friends_repo
git pull my_friends_repo master

关于git - 如何在没有互联网连接的情况下在 ubuntu 上提取 git 存储库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26157389/

相关文章:

postgresql - Ubuntu 中数据库 PostgreSQL 9.3 的密码验证失败

linux - 如何编辑 .gitignore 文件

ruby-on-rails - 用于分发离线 Ruby on Rails 应用程序的选项

javascript - 有没有办法在离线时使用 JavaScript 文件? (HTML/JADE/JS/离线)

java - Rsync 命令在 Java 中不起作用

ruby - 将数据从heroku中的refinerycms复制到apache托管网站

svn - git svn : Delta source ended unexpectedly

html - 为 html 创建一个离线搜索引擎

git 扩展和 *.xls

GIT 如何设置 .gitconfig 以将 *.woff 文件识别为二进制文件