Actions

PyCharm and github

From Mike Beane's Blog

Revision as of 11:02, 1 February 2020 by Rabbi Bob (talk | contribs) (→‎New Projects)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Background

First time setup with github (I've had the account forever, maybe did one thing in it for Minetest. Now that I'm in a class in programming (Python) and working between home and school, it's probably a good idea to get this working. For the class we are using PyCharm and I've made a quick list of getting things set up.

Setup

GitHub

  • Have GitHub account

Git

PyCharm

  • PyCharm->Settings-Git->"C:\Program Files\Git\cmd\git.exe"
  • Open PyCharm
  • Open from Repository
  • Get link from GitHub

Commit

  • Right click the file to commit->git->commit

Revoking Access

  • Status: Untested
  • TL\DR: Delete the applicable session token from https://github.com/settings/tokens to remove the classroom PyCharm access at the end of class.
  • Request: If you have other git\github\repo questions, please start a new discussion (easier to track and have conversations about the specifics)
  • Disclaimer: This is new to me, figuring it out as I go.

Background

While I was getting my github linked to the classroom computer, I noted that 1) I explicitly left my password out of the PyCharm settings and 2) I was challenged by a GitHub web-panel to auth when I attempted to access my private repo.  What I expected was that after closing PyCharm, I'd have to re-auth to use GitHub (why would I want to leave the shared PC linked to my GitHub instance?) and what I received however was a persistent connected session (even after reboot).I poked around PyCharm yesterday at the end of class to no avail and then it occurred to me  this morning that the web-panel challenge was the key.  I went looking around GitHub.  Here is what I found:

Steps

  • Log into the online GitHub account
  • Go to GitHub's Settings->Developer Settings->Personal Access Tokens
  • Find the token entry that is associated with the classroom computer
    • Classroom PC naming convention is STUDENPC-XX
    • git: https://github.com/ on STUDENTPC-23 at 31-Jan-2020 11:05
  • Delete the session token
    • Any applications or scripts using this token will no longer be able to access the GitHub API. You cannot undo this action
    • The classroom PyCharm should no longer have access and if used, should also ask for a re-auth the next time you try to invoke accessing the repo from class.  

Testing

New Projects

From GitHub Down

  • Start a project shell in GitHub
  • Grab the link from GitHub
  • Sync PyCharm
  • Setup files locally and commit

From PC Up