How to pull my unmerged commits on another machine

OK guys i’m currently working on  project everyday when i’m done i commit my changes for the project manager to see and aprove pretty normal stuff, today i got a message from him telling me to fix some of my changes  but  i’m currently away from my notebook i managed to get to a machine but i would like to clone the project i’m working on  and pull all those commits that have’t been merged on this new clone so i can fix the issues, reupload the fixes  and continue with life is tere a way to achieve this?

If your changes are in a branch on the GitHub repository, you can perform the following steps, assuming that the branch is named feature-branch:

git fetch
git checkout -b feature-branch origin/feature-branch

git fetch gets the latest state of everything from the remote repository. The git checkout command creates a new branch locally named feature-branch that “tracks” the feature-branch branch on the remote named origin. This remote tracking branch has the side effect of:

  1. Making your local feature-branch equal to the latest state of feature-branch on origin
  2. Setting up your feature-branch to push to feature-branch on origin when you run git push and are on feature-branch locally

I hope that helps!

3 Likes