Search code examples
gitgithubcommand-line-interfacegithub-cli

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?


Solution

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