Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails: Rubymine: GitHub

I can't seem to figure out how to commit my files to GitHub.

I am using RubyMine 4.5 on the MAC

I have git set up locally

I have a private account on GitHub

From the RubyMine Preferences, I have my GitHub credentials properly set up (and acknowledged as such by RubyMine), but it did not give me an option to select a repository on GitHub.

How do I commit file to the GitHub repository? There are too many CVS and Git menu items in RubyMine.

PS: I've read the online help sections (the only thing available to me), and I followed the instructions in the GitHub integration, but the directory I'm trying to commit is failing to push to GitHub, with RubyMine telling me that there was nothing to commit. This is the first time I use RubyMine for GitHub. Nothing about this on StackOverflow.

like image 862
EastsideDev Avatar asked Jul 23 '12 16:07

EastsideDev


1 Answers

Okay, I think I've recreated your situation locally and it appears that RubyMine has terrible support for managing remotes. If you create a Git repository locally, then (separately) create a repository on GitHub, there's no obvious way to marry the two from within RubyMine.

Basically, you need to set up GitHub as a remote for your local repository from the shell, and once that's done then RubyMine will be able to push as normal.

Please note that the below instructions assume you want to overwrite your GitHub repository with the full history from your local repository -- If your GitHub repository has data that you do not want to lose, do not execute these commands! See Below.

Open up Terminal:

cd /path/to/my/project/root
git remote add origin https://github.com/yourusername/yourrepo.git
git push -u origin +master

Now, RubyMine should be able to push to your GitHub repository via VCS > Git > Push

If your GitHub repository has already been committed to and you don't want to lose those changes, you'll need to either create a new GitHub repo or clone your GitHub repo into another folder and merge your local repository into the clone.

This can be avoided entirely if you're trying to push your existing local repository to a new GitHub repo: Simply use the VCS > Import into Version Control > Share project on GitHub option and use the dialog to create a new GitHub repository.

like image 144
Justin ᚅᚔᚈᚄᚒᚔ Avatar answered Sep 28 '22 14:09

Justin ᚅᚔᚈᚄᚒᚔ