I may be asking a dumb question, but I have yet to find a solution online. Using Pycharm, I have found how to create a local repository out of a regular project, but how do I then send that to github as a new remote repository? Is it possible for Pycharm to create remote repositories out of my local stuff, or do I have to pull down an existing repository before I can work remotely?
Open the project that you want to put under Git. From the main menu, choose VCS | Create Git Repository. In the dialog that opens, specify the directory where a new Git repository will be created.
Copy the GitHub URL for the new repo to the clipboard. Perform a git init command in the root folder of the existing project. Add all of the existing project's files to the Git index and then commit. Add the GitHub repo as a remote reference for the existing project.
You would need to log into github.com and create a new repository. The URL of the remote repository will be in the form of:
https://github.com/<username>/<reponame>
Then you need to tell Pycharm that the remote for your project is at that URL. I haven't used that IDE before so I can't give you exact steps but in the terminal it would be something like
git remote add origin <url>
You would be telling git to add a remote called "origin" at the url specified. Then after you have made some local commits you can push them with
git push origin master
That means that you want git to push your local branch master to the remote defined by origin which is the url you defined above. Pycharm probably has a GUI to define those remotes and then you'll be able to push to them once you created them on github.com
In the newer version of PyCharm (3.0+ - even the community version), after making as local branch you can easily use the push dialog to create the branch on the remote repo. Just select the checkbox at the bottom labeled "Push current branch to alternative branch" and the settings to the right should already reflect the branch you have created. Then just click the "Push" button. Done.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With