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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:23:45+00:00 2026-05-27T09:23:45+00:00

all of my git commit messages start with refs #SOME_NUMBER where SOME_NUMBER is a

  • 0

all of my git commit messages start with

  refs #SOME_NUMBER

where SOME_NUMBER is a number from 1 up. I would like to parse all commmit messages on
my working branch, store all of the SOME_NUMBERs in a list, remove duplicates, and save to file. Not really sure where to start….

  • 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-27T09:23:46+00:00Added an answer on May 27, 2026 at 9:23 am

    You can do that pretty easily with this shell one-liner:

    $ git log --format=%s | cut -f 2 -d ' ' | sed 's/#\(.*\)/\1/' | sort -n | uniq > refs.txt
    

    Explanation:

    1. git log --format=%s displays the first line of every commit message
    2. cut -f 2 -d ' ' splits the line by a space, and prints the second part of the (the #SOME_NUMBER portion)
    3. sed 's/#\(.*\)/\1/' removes the number sign from the number
    4. sort sorts the entries in ascending numerical order
    5. uniq ensures that each number is only printed once
    6. > refs.txt prints the output to a file called refs.txt.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to remove all changes to my working copy. Running git status
git-cherry lets me find all the commits missing from upstream. How do I find
Do all git commands have a --dry-run option, or one which would indicate what
I want to remove all files from Git at ~/bin/. I run git rm
I'd like to use git to record all the changes to a file. Is
I am making a git post-commit hook to post my commit messages to Twitter.
After completing a feature branch, during a git rebase -i I accidentally removed all
How can git commands like git add . and git commit -m be executed
First of all, I am a noob at using git. I was working on
when i enter git status i see something like: C:\cygwin\home\GIT\webapps>git status # On branch

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.