sourceforge上创建新的仓库

步骤如下,摘自sourceforge的帮助文档,但是要注意的一点是,在创建本地仓库之后,需要做一

次提交,才能执行其他的步骤。原因大概是因为没有做commit的话,本地仓库没有master这个分支。


How to push a local repository

Before you push your files, you need a local Git repository. You can either create one from scratch, convert a repository (e.g. via git-cvsimport or similar), or start with a copy of an existing Git repository.

For any local Git repository, you can configure it to push data back to our server by doing the following from inside your Git repository (this replicates what a "git clone " from our servers sets up for you automatically):

git remote add origin ssh://USERNAME@PROJECTNAME.git.sourceforge.net/gitroot/PROJECTNAME/REPONAME
git config branch.master.remote origin
git config branch.master.merge refs/heads/master

Now you're ready to push the committed files to our servers:

git push origin master

Note: The use of "origin master" prevents Git from complaining that the remote server has no branches in common with your local repository (which is true at the start when the remote repository is completely empty), and "master" is the default branch in Git.

After the first push, you will be able to use the simpler "git push " to push the master branch to our "origin" server.

Once that is done, you will be able to browse your newly-committed content via gitweb, clone the repository via either read-only or read/write access methods, push more check-ins, etc.

Creating Multiple Repositories

To create a new repository, you need to access the Shell service , then follow these steps:

  1. Navigate to your repository
    1. cd /home/scm_git/P/PR/PROJECTUNIXNAME
      • PROJECTUNIXNAME is the UNIX name of your project
      • P represents the first letter of that name, and PR the first two letters of the name.
  2. Create a new directory with the name you want for the repository, eg mkdir DIRNAME .
  3. Run git --git-dir=DIRNAME init --shared=all --bare (where DIRNAME represents the name of the repository to be created)
    • This will initialize a new repository at that directory

Notes: Developers should not nest directories / repositories. Directories should only be created the top level directory of repository. Be sure to make backups prior to editing your repository contents.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值