[英]Exporting java and spring project in a remote git repo
So I am working on a java, spring and maven based project and I have a remote repository where I want to export it. 所以我正在一个基于Java,Spring和Maven的项目上工作,我有一个远程存储库,我想在其中导出它。 As one can only export the .git projects in git repos, I have no idea how to create them and export the entire folder in the remote repository. 由于只能在git repos中导出.git项目,因此我不知道如何创建它们并在远程存储库中导出整个文件夹。 Kindly let me know. 请让我知道。 Thank you for your time. 感谢您的时间。 If I have framed the question improperly, just let me know. 如果我对问题的解答不当,请告诉我。
You can do git init --bare
on the target server. 您可以在目标服务器上执行git init --bare
。
Then do git remote add <name> <endpoint>
in the client project. 然后在客户端项目中执行git remote add <name> <endpoint>
。
Last but not least: git push <name> <branch>
最后但并非最不重要的一点: git push <name> <branch>
UPDATE UPDATE
SSH is excellent for doing this :) Suppose your project is called "test", do this: SSH非常适合执行此操作:)假设您的项目称为“测试”,请执行以下操作:
ssh remoteserver
cd /path/to/projects
mkdir test # make a new directory for your project
cd test
git init --bare # creates the git server repo
On your client 在您的客户上
git remote add origin ssh://user@host/path/to/projects/test
git push origin master
There are many different tools to assist you in committing and pushing your project into GIT. 有许多不同的工具可以帮助您提交项目并将其推入GIT。 If you are using an IDE, it probably has a GIT tool as part of its VCS library. 如果使用的是IDE,则它的VCS库中可能包含GIT工具。 Check out your IDE's documentation. 查看您的IDE文档。
If you want to do it from the command line, make sure you have GIT in your path. 如果要从命令行执行此操作,请确保路径中包含GIT。 Then go to your project fold and run the add, commit, and push. 然后转到您的项目折叠并运行添加,提交和推送。
git add –all
git commit -am "<commit message>"
git push
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.