首先, 如果你的ssh没有安装的话,要安装ssh服务端。ubuntu是很简单

  1. sudo apt-get install openssh-server

1,建立你的git 目录。

ourunix@ubuntu:~$ mkdir testgit

ourunix@ubuntu:~$ cd testgit/

2,建立你的git仓库。

ourunix@ubuntu:~/testgit$ git init

Initialized empty Git repository in /home/wlp/testgit/.git/

3,添加你的需要的项目初始文件,这里我就只添加一张文档了。

ourunix@ubuntu:~/testgit$ echo "hello,git" > sayhi.txt

4,跟踪及提交到仓库。

ourunix@ubuntu:~/testgit$ git add sayhi.txt

ourunix@ubuntu:~/testgit$ git commit -m "2011.4.13" sayhi.txt

[master (root-commit) b87b535] 2011.4.13

1 files changed, 1 insertions(+), 0 deletions(-)

create mode 100644 sayhi.txt

5.在本地的git仓库"添加一个远程仓库",当然这个远程仓库还是你自己的这个目录。

ourunix@ubuntu:~/testgit$ git remote add origin ssh://你的用户名@你的IP/~/testgit/.git

这时候,本地的 .git/config 应该会改变

6.将本地的 master分支 ,跟踪到远程的分支

ourunix@ubuntu:~/testgit$ git push origin master

7,显示远程信息

ourunix@ubuntu:~/testgit$git remote show origin

8,利用其他局域网的电脑测试你的仓库

ourunix@ubuntu:~/test$ git clone ssh://你的用户名@你的IP/home/~/testgit/.git

Initialized empty Git repository in /home/wlp/test/git/.git/

xxx‘s password:

remote: Counting objects: 3, done.

Receiving objects: 100% (3/3), done.

remote: Total 3 (delta 0), reused 0 (delta 0)

9,大功告成

10.  修改远程分支地址

git remote set-url origin remote_git_address

使用git建立远程仓库,让别人git clone下来的更多相关文章

  1. git初次建立远程仓库问题

    git "Could not read from remote repository.Please make sure you have the correct access rights. ...

  2. 【Eclipse中使用Git之一】把远程仓库的项目,clone到eclipse里面

    [Eclipse中使用Git之一]把远程仓库的项目,clone到eclipse里面 2015-01-29 19:25 15779人阅读 评论(1) 收藏 举报 .embody{ padding:10p ...

  3. windows下使用git和github建立远程仓库

    转自(http://www.bubuko.com/infodetail-430228.html) 从昨天开始就在看git的使用,因为在Windows下很多命令行操作都比较坑爹,但是今天再走了无数弯路之 ...

  4. 四、 git关联远程仓库及推送

    接之前笔记,在 github上建立与本地同名的仓库 demo 关联远程仓库 1. https 模式     远程库的名字就是origin,这是Git默认的叫法 git remote add origi ...

  5. git学习——远程仓库操作

    查看当前的远程库——git remote 列出了仅仅是远程库的简单名字 可以加上-v 现实对应的克隆地址 添加远程仓库——git remote add [shortname] [url] git re ...

  6. [转]git修改远程仓库地址

    原文链接:http://www.cnblogs.com/lazb/articles/5597878.html 问:Coding远程仓库地址变了,本地git仓库地址如何更新为最新地址 git修改远程仓库 ...

  7. 为git创建远程仓库

    首先生成ssh公钥: 将公钥添加到git: 测试秘钥是否通过: 然后就可以到web界面看到标注的地方被绿了: 但是我的没有绿,不知道为啥,难道没有女朋友的原因吗? rm -rf .ssh 重来好几遍都 ...

  8. git从远程仓库拉取内容或向远程仓库上传内容

    一.将本地文件上传到远程仓库步骤 git init git add . git commit -m "初始框架" git remote add origin https://git ...

  9. Git应用详解第五讲:远程仓库Github与Git图形化界面

    前言 前情提要:Git应用详解第四讲:版本回退的三种方式与stash 这一节将会介绍本地仓库与远程仓库的一些简单互动以及几款常用的Git图形化界面,让你更加方便地使用git. 一.Git裸库 简单来说 ...

随机推荐

  1. js控制滚动条平滑滚动到制定位置

    http://www.daixiaorui.com/read/92.html 滚动到顶部: $('.scroll_top').click(function(){$('html,body').anima ...

  2. iOS App TransportSecurity has blocked a cleartext HTTP (http://) resource load since it isinsecure. Temporary exceptions can be configured via your app's Info.plistfile

    “App TransportSecurity has blocked a cleartext HTTP (http://) resource load since it isinsecure. Tem ...

  3. iTop各数据表联系图(持续更新中)

  4. 使用本地phpmyadmin管理远程数据库

    使用放下挺简单的,因为某些业务需求,phpmyadmin不让放在网站服务器上,所以放在本地可以方便管理远程数据库 点击下载会下载一个  config.inc.php 吧这个文件放在phpmyadmin ...

  5. rabbitmq之消息转储vm_memory_high_watermark_paging

    rabbitmq为了预防内存达到上限,会在内存使用到了一定比例后,将消息转储到磁盘去.

  6. .Net using,string.Empty初探

    前两天够哦年公司培训,讲了编码优化.现在初步总结下:(有些不大确定的就不讲了) 多次字符串拼接(特别是循环内),宜用stringBuilder.Append()方法,少用字符串+,至于string.F ...

  7. 通过 Chrome Workspace 调试本地项目(修改样式时及时保存)

    打开 DevTools 开发者工具[F12]中的 Sources 面板,在面板左侧右键选择「Add folder to workspace」,选择添加的文件夹. 添加好后,右键一个文件,选择「Map ...

  8. 在block中使用self

    __weak typeof(self) weakSelf = self; [self doABlockOperation:^{     __strong typeof(weakSelf) strong ...

  9. Linux环境下apache性能测试工具ab使用详解

    网站性能压力测试是服务器网站性能调优过程中必不可缺少的一环.只有让服务器处在高压情况下,才能真正体现出软件.硬件等各种设置不当所暴露出的问题. 性能测试工具目前最常见的有以下几种:ab.http_lo ...

  10. VS2010的Razor智能感知和语法高亮突然消失

    猜想可能是安装了VS2008的原因,尝试重新安装下面的组件,看看是否解决问题: 用于 Visual Studio 2010 SP1 和 Visual Web Developer 2010 SP1 的 ...