Authorization with Token | Bondar Academy
Course: Git and GitHub Fundamentals
Module: Working with Git and GitHub
Instructor: Artem Bondar
Lesson Summary
This lesson covers the process of creating a personal access token on GitHub for accessing repositories from an independent terminal, rather than using the built-in terminal in Visual Studio Code . Steps to Create a Personal Access Token Log in to your GitHub account. Click on your account icon and select Settings . Scroll down to Developer settings . Select Personal access tokens and then Tokens classic . Click on Generate new token . Provide your GitHub account password. Fill in the token details: Name: e.g., "my token" Expiration: Choose duration (default is 30 days, or select "No expiration"). Access: Check repo for full repository access. Click Generate token and save the token securely, as it will not be displayed again. Using the Token for Git Operations To use the token for committing and pushing changes: Open an independent terminal. Navigate to your project directory using cd . Create a new branch with git branch new-branch and switch to it using git checkout new-branch . Make changes to your files. Stage changes with git add and commit using git commit -m "Your message" . Push changes with git push . When prompted for a username, enter your GitHub username, and for the password, use the personal access token instead of your account password. After successfully pushing, you can create a pull request on GitHub to merge your changes. This method allows for secure access to your repositories without using a username and password directly.