Reputation: 7730
This question is similar to this one for Eclipse but with a different IDE.
How can I add my pre-existing Java to git in IntelliJ IDEA?
Current State:
I could check out the new repository, copy the contents of my project to this directory and just push to master, but is there a simpler way within the IDE that avoids changing the location of the project?
Upvotes: 7
Views: 6981
Reputation: 44090
'VCS' on the menu bar > 'Import into Version Control' > 'Create Git repository...'
To hopefully somewhat future-proof this answer in case the location moves, you can use:
CtrlShiftA (or CommandShiftA on a Mac) to open the action search dialog and search for 'create git'.
Upvotes: 6
Reputation: 9938
VCS > Import into Version Control > Create Git Repository
VCS > Git > Remotes
+
button, leave origin as-is and paste the Git URL of your repositoryVCS > Git > Git Pull
then VCS > Git > Git Push
Upvotes: 9