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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:26:24+00:00 2026-05-21T05:26:24+00:00

I have a commit xyz in my local branch that I want to check

  • 0

I have a commit xyz in my local branch that I want to check if it is included in a remote release repository; can I do that in some easy way? I could clone the remote repo, but I’m hoping for a nicer+faster way. git ls-remote seemed promising, but found nothing of value to me there. Thanks!

  • 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-21T05:26:25+00:00Added an answer on May 21, 2026 at 5:26 am

    Let’s suppose that the remote that refers to the remote repository is called origin. In that case, first update all your remote-tracking branches with:

    git fetch origin
    

    Now you can use the useful --contains option to git branch to find out which of the remote branches contains that commit:

    git branch -r --contains xyz
    

    (The -r means to only show remote-tracking branches.) If the commit xyz is contained in one or more of your remote-tracking branches, you’ll see output like:

      origin/test-suite
      origin/HEAD -> origin/master
      origin/master
    

    If it’s contained in your local repository, but not one of the remote-tracking branches, the output will be empty. However, if that commit isn’t known in your repository at all, you’ll get the error malformed object name and a usage message – perhaps a bit confusing if you’re not expecting it…

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

Sidebar

Related Questions

I have local commit that are not on any branch that I would like
In git, i have 2 commit and a branch merge that have been rebased
I have repository on GitHub to which I commit regularly from my local computer.
I have my branch on my GIT repository where I used to commit and
I have a commit-msg hook that I run for all of my local commits
For example I have this commit fa33745860726a363287962232787f23585a46e9 , I want to know which branch
I have a commit c. I want to get the changeset of that exact
I have a commit, I have stored in a branch, because this should go
I'd like to have a commit message cleanup that will not necessarily remove lines
I have a post-commit hook in svn that runs fine from the command line

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.