So basically this is a pretty "nooby" question but how would I get the latest version of my code from a GitHub repo? In my case, I code on both PC and Mac but I'd like to work on a project on both machines. For example, say if I started a project on PC, coded something and pushed it onto GitHub, then cloned that GitHub repo onto my Mac and coded some more and pushed that code to Github. How would I now update the code on my PC to match the code in the GitHub repo and vice-versa? Thank You!
If what you are looking for is to know the latest commits that have been done on that repo you should go for
git log --all --oneline
This will list in chronological order all the commits of the repo starting from the most recent one. Instead if you want to look for a stable version of the code you should probably do
git pull origin master
where by convention usually you can find the latest stable version. Beware that this may not be true everywhere and people is not obliged to follow this convention.
Probably:
git pull origin master
If your default branch is different than master, you will need to specify branch name :
git pull origin default_branch_name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With