Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 679547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:16:18+00:00 2026-05-14T01:16:18+00:00

What are the Git commands to do the following workflow? Scenario I cloned from

  • 0

What are the Git commands to do the following workflow?

Scenario

I cloned from a repository and did some commits of my own to my local repository. In the meantime, my colleagues made commits to the remote repository. Now, I want to:

  1. Check whether there are any new
    commits from other people on the
    remote repository, i.e. origin?

  2. Say there were three new commits on the
    remote repository since my last
    pull, I would like to diff the
    remote repository’s commits, i.e.
    HEAD~3 with HEAD~2, HEAD~2 with
    HEAD~1 and HEAD~1 with HEAD.

  3. After knowing what changed remotely,
    I want to get the latest commits
    from the others.

My findings so far

For step 2: I know the caret notation HEAD^, HEAD^^ etc. and the tilde notation HEAD~2, HEAD~3, etc.

For step 3: That is, I guess, just a git pull.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:16:19+00:00Added an answer on May 14, 2026 at 1:16 am

    You could git fetch origin to update the remote branch in your repository to point to the latest version. For a diff against the remote:

    git diff origin/master
    

    Yes, you can use caret notation as well.

    If you want to accept the remote changes:

    git merge origin/master
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my repository, I have created tags using the following commands. git tag v1.0.0
I wanted to mirror my git repository, so I did the following over SSH:
I have a git repository with some commits in it. I want to reproduce
Some Git commands take commit ranges and one valid syntax is to separate two
I just ran the following commands on my Ruby on Rails project: git init
What are the differences between the following git commands? git diff HEAD git diff
The following commands $ git co -b newbranch $ git co oldbranch result in
I do the following string of commands for git and my fingers are getting
I am new to git. I am wondering whether the following scenario is supported,
I have tried following how-set-up-your-own-private-git-server-linux and private-remote-git-repositories-ubuntu-linode but I am still having problems. My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.