Pycharm -- how can I push a local project to a remote organization repo?
Asked Answered
T

4

11

I can push to my personal github account, but I am trying to push to an organization repo. How can I configure Pycharm to use an organization repo instead of a personal one? Thanks.

Toplevel answered 27/6, 2014 at 1:33 Comment(2)
how to do you push a new project from PYCHARM to personal github accountUrsi
I got the answer on how to push the project from PYCHARM to personal github account jetbrains.com/help/pycharm/…Ursi
C
4

This seems not to work, I had the same problem.

This was my workaround:

  1. Create a new github organization repository and name it like your local project
  2. Open PyCharm and checkout the organization project into a directory different from your PyCharm project directory (if your local project with the same name lies there)
  3. Close PyCharm and copy all files and folders from the checked out organization repository into your local project folder
  4. Open your local project in PyCharm and add the .idea folder (with contains your PyCharm IDE project information) to the .gitignore file
  5. Finally commit and push your local project content to your organization repository!
  6. (Don't forget to delete the your former checkout folder)

This works because all git-paths are relative.

Caracul answered 15/8, 2014 at 11:46 Comment(0)
R
7

This worked for me.

  1. close PyCharm
  2. open a terminal in or from terminal navigate to the local project directory.
  3. run your version of: git remote add origin https://github.com/<organization>/<project>.git
  4. open PyChram and push project: "VCS"->'git'->'push'
Roswell answered 9/2, 2018 at 18:51 Comment(0)
C
4

This seems not to work, I had the same problem.

This was my workaround:

  1. Create a new github organization repository and name it like your local project
  2. Open PyCharm and checkout the organization project into a directory different from your PyCharm project directory (if your local project with the same name lies there)
  3. Close PyCharm and copy all files and folders from the checked out organization repository into your local project folder
  4. Open your local project in PyCharm and add the .idea folder (with contains your PyCharm IDE project information) to the .gitignore file
  5. Finally commit and push your local project content to your organization repository!
  6. (Don't forget to delete the your former checkout folder)

This works because all git-paths are relative.

Caracul answered 15/8, 2014 at 11:46 Comment(0)
I
1

This worked for me:

  1. Goto Git > Manage Remotes
  2. Add your repo remote (Organization repo)
  3. Once it asks you to login with GitHub, click "Login with token"
  4. Generate a GitHub token on github.com and grant the permissions PyCharm tells you to but make sure you allow "org:write" too.
  5. Input your generated token
  6. And boom! You should be able to push to organizations
Incised answered 17/6, 2022 at 15:25 Comment(0)
R
0

This may not be a direct answer to the question, but it caused me a great deal of frustration with using an Organization with PyCharm until I figured it out.

Here is what I ran into:

  • Could see another organization's repos
  • Could NOT see a new organization's repos I created

You must turn off Third-party Application Restrictions in the GitHub organization in question.

To do that:

  1. Navigate to the organization in question
  2. Use the Settings button to get to the organization's settings page
  3. On the left-hand side, scroll toward the bottom to OAuth Application Policy
  4. Click the Remove Restrictions button

Once I cleared that setting, I was immediately able to see and work with the repos in my new organization. Upon clearing that setting, the button changes to Setup application access restrictions. I recommend configuring third-party access reasonably to align with your organization's security best practices.

Here's a reference from GitHub on the matter:

Riana answered 5/7 at 20:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.