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

  • Home
  • SEARCH
  • 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 6671005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:20:08+00:00 2026-05-26T03:20:08+00:00

I have very poor knowledge about git and would like to ask for help.

  • 0

I have very poor knowledge about git and would like to ask for help.

I have a linux(-only) application which shall only be “downloaded” (i.e. cloned) with git. On startup, the app shall ask the git “master server” (github) for whether there are updates.

Does git offer a command to check for whether there is an update (without really updating – only checking)? Furthermore, can my app read the return value of that command?

  • 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-26T03:20:09+00:00Added an answer on May 26, 2026 at 3:20 am

    If you do not want to merge, you can just git fetch yourremote/yourbranch, the remote/branch specification usually being origin/master. You could then parse the output of the command to see if new commits are actually present. You can refer to the latest fetched commit as either yourremote/yourbranch or possibly by the symref FETCH_HEAD.

    Note: I was reminded that FETCH_HEAD refers to the last branch that was fetched. Hence in general you cannot rely on git fetch yourremote with FETCH_HEAD since the former fetches all tracked branches, thus the latter may not refer to yourbranch. Additionally,

    • you end up fetching more than strictly necessary.
    • also refer to Jefromi’s answer to view but not actually downloaded changes
    • the following are not necessarily the most compact formats, just readable examples.

    That being said, here are some options for checking for updates of a remote branch, which we will denote with yourremote/yourbranch:

    0. Handling errors in the following operations:

    0.1 If you attempt to git fetch yourremote, and git gives you an error like

    conq: repository does not exist.
    

    that probably means you don’t have that remote-string defined. Check your defined remote-strings with git remote --verbose, then git remote add yourremote yourremoteURI as needed.

    0.2 If git gives you an error like

    fatal: ambiguous argument 'yourremote/yourbranch': unknown revision or path not in the working tree.
    

    that probably means you don’t have yourremote/yourbranch locally. I’ll leave it to someone more knowledgeable to explain what it means to have something remote locally 🙂 but will say here only that you should be able to fix that error with

    git fetch yourremote
    

    after which you should be able to repeat your desired command successfully. (Provided you have defined git remote yourremote correctly: see previous item.)

    1. If you need detailed information, git show yourremote/yourbranch and compare it to the current git show yourbranch

    2. If you only want to see the differences, git diff yourbranch yourremote/yourbranch

    3. If you prefer to make comparisons on the hash only, compare git rev-parse yourremote/yourbranch to git rev-parse yourbranch

    4. If you want to use the log to backtrack what happened, you can do something like git log --pretty=oneline yourremote/yourbranch...yourbranch (note use of three dots).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multithreaded application in which my thread utilization is very poor (in
I have legacy asp.net 1.1 website. It has a very poor VB layered achitecture.
I have very simple select like this: SELECT * FROM table WHERE column1 IN
I have very long integer sequences that look like this (arbitrary length!): 0000000001110002220033333 Now
So, my problem is that my knowledge of CAML and Sharepoint is very poor.
I have class foo that contains a std::auto_ptr member that I would like to
Hi i would like to set several languages on my site, a have good
when the average ASP.net C# programmer (with very poor JavaScript knowledge other than scripting
I have a very poor experience in writing batch-files. And I need to do
I have a very poor understanding of exception handling(i.e., how to customize throw, try,

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.