我应该如何将intelliJ项目添加到已经存在的Github存储库中? [英] How should I add my intelliJ project to an already existing Github repository?

查看:89
本文介绍了我应该如何将intelliJ项目添加到已经存在的Github存储库中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经有一个Github仓库,但是我需要将实际项目添加到该仓库中.我应该如何使用IntelliJ来做到这一点?当然,应该对项目进行版本控制.

I already have a Github repository, but I need to add my actual project to the repository. How should I do this with IntelliJ? The project should be versioned of course.

推荐答案

一旦在项目根目录中找到.git目录,IntelliJ就会自动发现并添加"您的git存储库.您必须运行的步骤取决于您是否已经为项目初始化了一个Git存储库.如果不是,请先打开一个终端(例如,通过按ALT + F12在IntelliJ中打开终端窗口)并运行

IntelliJ will automatically discover and "add" your git repository as soon as it finds a .git directory in the project root directory. The steps you have to run depend on whether you already have a Git repository initialized for your project or not. If not, first open a terminal (e.g. by pressing ALT+F12 for opening a terminal window in IntelliJ) and run

git init

之后(或者,如果您的项目中已经有git存储库),可以使用以下方式将这个存储库连接"到Github上的项目中:

Afterwards (or if you already have a git repository in your project) you can "connect" this repository to your project on Github with

git remote add origin GIT_URL_ON_GITHUB

然后,IntelliJ将查找"您的存储库并提供git支持.

IntelliJ will then "find" your repository and offer git support.

这篇关于我应该如何将intelliJ项目添加到已经存在的Github存储库中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆