我应该如何将我的intelliJ项目添加到现有的Github存储库中?

问题描述:

我已经有一个Github存储库,但我需要将我的实际项目添加到存储库。我应该如何用IntelliJ来做到这一点?该项目当然应该进行版本控制。我应该如何将我的intelliJ项目添加到现有的Github存储库中?

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

git init 

之后(或者,如果你已经在你的项目中一个Git仓库),你可以在“连接”这个仓库到Github上项目与

git remote add origin GIT_URL_ON_GITHUB 

的IntelliJ然后将“发现”你的资料库,并提供Git支持。

可以初始化你的项目作为一个Git仓库使用以下步骤的本地目录:https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/

然后,如果你的Git插件的IntelliJ,去版本控制研究,提交更改,然后你可以把。

我不知道你对IDEA热键有多熟悉,因此使用顶部导航栏的指令:VCS -> Enable Version Control Integration -> Select your version control system (Git in your case) -> Wait for IDEA to update project -> Your project hierarchy now shows all files in brown color -> Select the files you want to commit -> Right click and select Git-Add -> In the bottom navigation bar you should also see "9: Version Control" -> Click on this button -> The window with uncommited changes appears and recently added files are green-colored -> Select the files you want to commit -> Right click on the files -> Select "Commit Changes" from the popup menu -> Specify commit message -> Hover over the "Commit" button -> Press "Commit and Push" -> In the dialog you can specify the master branch of your origin repo on Github -> Press Push after that -> You're done

随意问我是否错过了水手。出。