Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating remote repository out of local ones, Pycharm

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?

like image 296
EasilyBaffled Avatar asked Jul 26 '13 17:07

EasilyBaffled


People also ask

How do I create a repository in PyCharm?

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.

How do I add a remote repository to an existing project?

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.


2 Answers

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

like image 140
Alex Ionescu Avatar answered Sep 30 '22 12:09

Alex Ionescu


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.

like image 41
The NetYeti Avatar answered Sep 30 '22 11:09

The NetYeti