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 8845971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:51:45+00:00 2026-06-14T11:51:45+00:00

Say I did a Git clone from a URL for a repository. I made

  • 0

Say I did a Git clone from a URL for a repository. I made some changes to a file, did a Git commit.

When I do a git pull, I see that it says "Already up-to-date".

Shouldn’t it show something that says I am not up to date?

My question is:

  1. say I did the change above to my local repository, but do not commit for two days, but before the two days are up, someone else had made a change to the remote repository. What steps must I do to ensure I am not overriding changes in the remote repository or at least be able to pull the latest changes before committing?

  2. Is there some way to diff between my local repository and the remote repository to check what differences there are? (in case I just want to recall what I had before?)

  • 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-06-14T11:51:47+00:00Added an answer on June 14, 2026 at 11:51 am

    My first advice is to not git pull. Do a git fetch followed by a git merge.

    To answer your zero’th question: In fact, you are up-to-date. You have all the commits that the remote repository has. So, there is nothing left to fetch or merge1.

    To answer your first question:

    1. git commit: commit your changes on your own branch, totally unrelated to what’s going on in remote repositories.
    2. git fetch origin: get the contents of the remote repository (origin), but keep them under origin/branch branches. Your own code is unaffected at this point.
    3. git merge origin/master: merge origin/master which is the master branch of the remote repository origin (which you fetched just now) with your current branch.
    4. git push origin: push back the commit and the merge to the remote repository

    To answer your second question:

    1. git fetch origin: update origin/branch branches.
    2. git diff origin/master: get the difference between your current branch and the branch origin/master.

    1 Suppose this is what the commits in your repository initially look like, on branch master:

    A -> B -> C -> D -> E
                        |
                        |\- master
                        |
                         \- origin/master
    

    This is right after you cloned the repository. Now you say you have made a new commit on your local branch master:

    A -> B -> C -> D -> E -> F
                        |    |
                        |     \- master
                        |
                         \- origin/master
    

    So there are two things to observe here.

    1. Assuming no activity by somebody else in the remote origin, there is nothing new to fetch. So git fetch origin master tells you there is nothing new.

    2. If you do git merge origin/master, again, there is nothing to merge. origin/master is a prefix of master. In other words, master already contains all the commits that origin/master has, so there is nothing new to merge.

    If you had used fetch and merge instead of pull, you could easily understand which part of the double-command (pull) is the one that results in unexpected (in your opinion) behavior.

    Of course, after a git push origin master, you will get:

    A -> B -> C -> D -> E -> F
                             |
                             |\- master
                             |
                              \- origin/master
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First let me say that I did see this article: How to remove AspxAutoDetectCookieSupport
let's say i did add some exe file to the project's resources. now if
I did a few commits, say commit A, B, C Now I want to
Before someone said that I did not read I may say that I read
Let's say I did this: script/generate controller home And in the home controller made
Hi Masters Of Web Development, first I want to say that I did not
Say I have a branch A, and from that I branch B. I make
I'm having a problem with getting my Git repository to function the way that
I have local git repository on my pc with 2 branches, let's say branch1
Lets say I did a check out, edited some stuff and realized I want

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.