DEV Community

Cameron Ernest
Cameron Ernest

Posted on

Connecting Sourcetree with Github on Windows

Getting Started with Sourcetree

You can download Sourcetree

Creating Personal Access Tokens in Github

You need to create a Personal Access Token in Github which will be used to for authentication purposes

Git installation

Once you download Git for Windows, and complete the installation, the git bash window appears.

Removing the remote origin link

Navigate to the folder where the local repository exits.

Then enter the following command to make sure no existing remote origin link exists

git remote remove origin
Enter fullscreen mode Exit fullscreen mode

Once confirmed, the PAT created should be mentioned for the appropriate repository

git remote add origin https://<personal-access-token>@github.com/<my-repo>.git>
Enter fullscreen mode Exit fullscreen mode

For eg:

git remote add origin https://ghp_2B1FRo1HQRAoevdp3oMEa34PQVuuDX5LYk1f@github.com/johndoe/myrepo.git
Enter fullscreen mode Exit fullscreen mode

After successful completion, you should be able to push the changes from Sourcetree to Github.

P.S: There is a lot more information that needs to be added. I just wanted to make my first post, so here it is! I will be editing it further and add the required information and complete it fully. Thank you.

Discussion (0)