Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub CLI how to do a simple pull?

I code on my local machine, push it to my remote repository on github and then login via ssh on the target machine, pull it, build it and run it.

This typically requires me to enter my login data everytime I want to do it, on the local machine. I have discovered git cli, so I installed it on the target machine.

$ gh --version
gh version 2.6.0-15-g1a10fd5a (2022-03-16)
https://github.com/cli/cli/releases/latest

I authenticated myself via

$ gh auth login

and now I want to simply pull the latest commit. But there's no pull command. There is a pull request command, i.e. gh pr but this just tells me there aren't any.

How can I simply pull my latest commit, akin to git pull, without needing to type in my login information again?

like image 471
infinitezero Avatar asked Apr 22 '26 05:04

infinitezero


2 Answers

You could do gh repo sync it will update the local repo by comparing it with the remote repo.

like image 188
Omi Harjani Avatar answered Apr 24 '26 19:04

Omi Harjani


You can‘t (as fas as I know).

The GitHub CLI is a command-line tool to do the work as in GitHub itself like pull requests, issues, GitHub Actions, and other GitHub features.

The same as on GitHub-website, but simple on the command-line. If you want to pull the latest changes from a GitHub repository, you need Git (the version-control tool) and the command git pull.

like image 22
SwissCodeMen Avatar answered Apr 24 '26 20:04

SwissCodeMen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!