简体   繁体   English

在远程Git仓库中导出Java和Spring项目

[英]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.

相关问题 如何在git repo中将Spring jar添加到Java Project镜像文件夹 - How to add Spring jars to Java Project mirroring folder in git repo 如何将来自Git的分叉存储库包含到我的Eclipse Java项目中? - How to include a forked repo from Git into my eclipse java project? 用Java导出项目(Eclipse) - Exporting project in Java(Eclipse) 将文件从 web 应用程序(弹簧启动)提交到 git 远程存储库,而不首先将存储库克隆为本地? 这可能吗 - commit file from a web application (spring boot) into git remote repository without first cloning the repo as local? is this possible Spring Cloud Config Server还能将配置更新推送到远程git repo吗? - Can the Spring Cloud Config Server also push config updates to the remote git repo? 在Eclipse中为可运行的Java项目使用远程git资源 - Using a remote git resource in eclipse for a runnable java project Git存储库-切换项目本地存储库并将其推送到现有的git存储库 - Git repository - switch project local repo and push it to existing git repo 列出一个git远程仓库的分支而不克隆它 - List branches of a git remote repo without cloning it 导出Spring Boot JAR以进行远程部署 - Exporting Spring Boot JAR for remote deployment 导出使用PostgreSQL的Java项目 - Exporting a Java project that uses PostgreSQL
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM