Hello! This is a script that makes for you the following :
- -> Navigate to the folder that you store your projects (CD "PATH")
- -> Creates Folder with Project name (MKDIR %1)
- -> Navigates into Folder (CD %1)
- -> runs:
git init
- -> Goes to Github and Create the repository (createRepo.py)
- -> Adds the remote to the Local folder.
- -> Creates a ReadMe file.
- -> runs:
git add .
- -> runs:
git commit -m "Init commit"
- -> runs:
git push -u origin master
- -> runs:
code .
- -> Open CMD.
- -> Run: pip install PyGithub
Download the source code and save all files into a single folder.
To access the github API you need to create an access token. To do that you need:
- -> A Github Account with validate Email.
- -> Navigate into your Github account. -> Settings -> Developer Settings -> Personal Access Tokens -> Generate new token.
- -> Provide a usefull name for your token use and copy the token value.
- -> Select all the access points that there are.
- -> Save the token value in a .txt or anywhere for now but notice that this should be kept secret.
- -> Open the secret.py
- -> Copy the token value and place it into the variable token (e.g.:
token = "your_token_value"
) - -> Always keep createRepo.py and secret.py in the same folder.
- -> Open the create.bat file.
- -> At line 1 change the directory
S:
to the directory you mostly store your documents. (e.g.:C:
) - -> At line 2 change the current path to the path(THE COMPLETE PATH) that you want your projects to exist (e.g.
C:\Documents\Coding\MyProjects
). - -> At line 6 change the current path with the path that your createRepo.py file exists (AGAIN THE COMPLETE PATH).
- -> At line 11 change the github URL to include your USERNAME (mine:
https://github.com/AristidisKantas/%1.git
----> yours:https://github.com/YOUR_USERNAME/%1.git
)
- -> Copy the create.bat file.
- -> Paste it in
C:\Windows\System32
- -> Open CMD.
- -> Run:
create YourProjectName