The term repository is used to denote an overarching project that is version controlled with Git. Given that there are two main components to working with Git (Git client and GitHub), there are two separate processes you need to go through to set up a repository that is version controlled and these are as follows:
- Firstly, you need to initialize the project that is to be put under version control as a repository on your local system. This can be done with a simple command (git init), which is to be executed at the root directory of the project.
- Second, you need to create a corresponding repository on GitHub. While logged in with your GitHub account, click on the + button in the top-right corner of the site and choose New repository.
- Next, GitHub will take you through multiple steps to customize various information about your repository. At this stage, you should only enter the name of the repository and leave all the other options as is.
- Finally, you need to associate the local repository to one stored on GitHub—this process is called adding remotes. To do this, you can run the following Git command:
git remote add origin https://github.com/PacktPublishing/Hands-on-Application-Development-with-PyCharm
The previous steps outline the process for setting up a local Git repository on GitHub. Next, we will learn about the process of transferring data from your local repository to GitHub.