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.Answer1:
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
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 will then "find" your repository and offer git support.Answer2:
You can initialize the local directory of your project as a Git repository with the following steps: <a href="https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/" rel="nofollow">https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/</a>
Then, if you have Git plugin for IntelliJ, go to version controll, commit changes, and then you can push.Answer3:
I don't know how familiar you are with IDEA hotkeys, therefore the instruction using top navigation bar:
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.
Feel free to ask if I missed smth. out.