Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

How To Push Code From Eclipse To GitHub Repo Using Access Token?

Posted on 02/19/2025 By admin

Earlier when we used to perform any git actions such as pushing code from the local repository to a GitHub repository then we needed to pass our username and password to authenticate the action. But now GitHub has removed Support for password authentication since August 2021. Now we need to use a GitHub Personal Access Token (PAT) instead of the password.

Let’s learn step by step process to push code from the local repo in Eclipse to GitHub using GitHub Personal Access Token (PAT).

Give a proper repository name. You can select either public or private. If you are a beginner in Git then do a similar setup as shown below.

Click on the “Create repository” button to complete the creation of the new repo. You can see the URL for the new repository in the below image – https://github.com/amod-mahajan/UseAccessToken.git

I will use Eclipse IDE to create a basic Java project with a simple Hello World program.

Right-click on Project -> Team -> Share Project

Check the “Use or create repository in parent folder of project” checkbox. Then select the Project Name and click on the “Create Repository” button.

Click on the “Finish” button.

Perform Right-click on Project -> Team -> Commit

Drag a file/s from “Unstaged Changes” to “Staged Changes“. Give a meaningful commit message and click on the “Commit” button.

Perform Right-click on Project -> Team -> Remote -> Push

Copy and paste GitHub URL in the URI field as shown below. Values for the Host and Repository path will be auto-populated. Click on the Next button.

Select the Source ref as the master branch i.e. default branch. Destination ref will be automatically populated.

After that click on “Add Spec” button.

Click on the “Finish” button.

At this stage, you will be asked to provide login credentials for your GitHub account. Now you can not use the actual password of your GitHub account here. We need to generate a Personal Access token for our GitHub account. Follow the steps below.

Click on the Profile icon at the right top corner and click on “Settings“.

Scroll down all the way and click on Developer settings.

You will see “Personal access tokens” as shown below.

There are two types of tokes.

  1. Fine-grained tokens – It is in the Beta stage as of now. It is a repository-scoped token.
  2. Tokens (classic) – It is not repository-scoped. A generated token can be used for any of your GitHub repositories.

We will use a classic token for this post. Select “Tokens(classic)” and Click on “Generate new token“.

Now you need to provide the value of “Note” and select Scope. The scope is to define the actions which can be performed with a token. You can choose any value for Expiration as required. After all these steps, scroll all the way down and click on the “Generate token” button.

You will see a token is generated. Remember to copy and save it.

Now the generated token with your username needs to be passed to the credential window that popped up in Eclipse.

After successful login, the committed code will be pushed to remote.

Thanks for reading.

Uncategorized

Post navigation

Previous Post: Common Mistakes & Best Practices in Selenium
Next Post: Log4j2 Tutorial 6 – Introduction to RollingFileAppender and its Triggers and Strategies

Related Posts

API Testing – REST Assured – Page 6 Uncategorized
May 5, 2019 – Make Selenium Easy Uncategorized
August 2017 – Make Selenium Easy Uncategorized
Interview Experience Uncategorized
HeadersInAPI – Make Selenium Easy Uncategorized
URL Loading in Selenium Webdriver: All about get() and navigate() | Make Selenium Easy Uncategorized

Recent Posts

  • Getting Started with Selenium 4: What Is New and How to Upgrade from Selenium 3
  • Manual Testing
  • Baby Steps To Become Efficient Selenium-Java Automation Tester
  • Features of Selenium 4.0.0 Release – Java Binding
  • Part 1: Handling Drop-down Created Using SELECT Tag In Selenium

Recent Comments

No comments to show.

Archives

  • April 2026
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • April 2024
  • March 2024
  • February 2024
  • December 2023
  • October 2023
  • August 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • May 2022
  • March 2022
  • October 2021
  • April 2021
  • March 2021
  • January 2021
  • December 2020
  • October 2020
  • September 2020
  • August 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • May 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • January 2018

Categories

  • Getting Started
  • Uncategorized

Copyright © 2026 Make Selenium Easy.

Powered by PressBook Masonry Dark