Git: Setup a remote Git repository

o setup a folder on a server which service for remote Git repository, apply the following steps:

  1. Create a folder on a shared server.
  2. Apply the git command on that folder: git init –bare
  3. Add that folder as the remote repository. In visual studio, it’s quite easily. You enter the ‘name’, ‘path’ in a popup dialog when you adding a remote repository.
  4. That’s not enough yet. You will get a failed message when pushing to the new-added remote repository. The problem here is, the local ‘master’ branch is not tracking the remote ‘master’ branch yet To add such kind of tracking, you need add the following changes manually:
    1. Open .git folder, open the config file (without extension) in the text editor.
    2. Add following codes.
[branch "master"]
    remote = origin
    merge = refs/heads/master

Now, you can enjoy coding with you next setup repository.

是为之记。
Alva Chien
2016.5.23

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值