PyCharm and github: Difference between revisions
From Rabbi Blog
mNo edit summary |
m (→New Projects) |
||
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
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. | 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. | ||
=GitHub= | =Setup= | ||
==GitHub== | |||
* Have GitHub account | * Have GitHub account | ||
=Git= | ==Git== | ||
* Download Git | * Download Git | ||
** * https://git-scm.com/download/win | ** * https://git-scm.com/download/win | ||
Line 11: | Line 12: | ||
* Accept defaults (usually) | * Accept defaults (usually) | ||
=PyCharm= | ==PyCharm== | ||
* PyCharm->Settings-Git->"C:\Program Files\Git\cmd\git.exe" | * PyCharm->Settings-Git->"C:\Program Files\Git\cmd\git.exe" | ||
* Open PyCharm | * Open PyCharm | ||
Line 17: | Line 18: | ||
* Get link from GitHub | * Get link from GitHub | ||
=Commit= | ==Commit== | ||
* Right click the file to commit->git->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 | |||
** https://github.com/settings/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= | =Testing= | ||
==New Projects== | ==New Projects== | ||
===From GitHub Down=== | |||
* Start a project shell in GitHub | * Start a project shell in GitHub | ||
* Grab the link from GitHub | * Grab the link from GitHub | ||
* Sync PyCharm | * Sync PyCharm | ||
* Setup files locally and commit | * Setup files locally and commit | ||
===From PC Up=== | |||
* From the main menu, choose VCS | Import into Version Control | Create Git Repository. | |||
** Reference: https://www.jetbrains.com/help/pycharm/set-up-a-git-repository.html | |||
[[Category:Programming]] | [[Category:Programming]] |
Latest revision as of 11:02, 1 February 2020
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
- Download Git
- Install C:\Program Files\Git
- Accept defaults (usually)
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
- From the main menu, choose VCS | Import into Version Control | Create Git Repository.