如何在用户的gitlab上传项目?

时间:2015-05-26 06:33:49

标签: gitlab

我们正在使用Gitlab(7.5.3)。

我创建了一个存储库,但我想将项目上传到它。

我已经在存储库页面上查找了某种上传按钮,但我还没有看到任何类型的内容。

我看过目前为止提供的链接,但我仍然无处可去。他们提到命令行,是Windows命令行吗?

我可以通过Git GUI上传,如何在没有Git GUI的情况下上传?

当我通过putty登录用户帐户时,显示

login as: root
root@192.168.1.5's password:
Last login: Tue May 26 12:20:10 2015 from 192.168.1.12
![grep: write error]

有谁知道我们如何解决这些问题?

2 个答案:

答案 0 :(得分:7)

如果您有Git GUI,您可能还有Git Bash,它为Windows内的git提供命令行支持。

您可以使用此Git Bash上传您的项目。为此,您只需要一些git命令,而且您不必登录Gitlab的服务器(我认为这就是您尝试的原因)。当您创建一个新项目并希望上传它时,Gitlab会提供此命令。

首先打开Git Bash。然后:

cd c:\Users\Me\..\my_project\   # Go to your project directory in Windows
git init                        # Initialize this directory as a git repo
git remote add origin git@your_gitlab_server_ip:your_username/your_project_name.git
git push -u origin master`      # Send your code to your Gitlab instance

提供有关您的一些信息也是一个很好的理想选择。此信息将由Gitlab显示:

git config --global user.name "Your Name"
git config --global user.email "your_name@your_mail.com"

请记住,使用Gitlab,你的git&repo和Gitlab之间的唯一交互应该通过git命令发生,而不是登录到这个服务器。

答案 1 :(得分:0)

尝试此四步将项目推送到gitlab->打开命令行。

cd to/path/local
git init
git remote add anything_name name http://scmgit.ktb/username/projectname.git
git push -u test anything_name master

希望可以节省您的时间。