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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:07:09+00:00 2026-05-26T14:07:09+00:00

How can I cleanup git working file set (like hg up -r null )?

  • 0

How can I cleanup git working file set (like hg up -r null)?

So only $proj/.git hierarchy present and git st don’t show D (deleted).

  • 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-26T14:07:10+00:00Added an answer on May 26, 2026 at 2:07 pm

    After clarifications in your comments, it seems that you want to create a new root commit in your repository. There’s a description of how to do this in the git community book.

    First, make sure that the output of git status is clean, so that you don’t lose any of your previous work unintentionally. Then if you do the following:

    git symbolic-ref HEAD refs/heads/newbranch 
    rm .git/index 
    git clean -fdx 
    git commit --allow-empty -m 'Initial empty commit'
    

    Then you will be on a new branch called newbranch, with a single root commit with an empty tree. If you then decide that you want this to be your new master branch, you can do:

    git branch -m master oldmaster
    git branch -m newbranch master
    

    … which renames your old master branch to oldmaster, and then renames the new newbranch branch to master.

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

Sidebar

Related Questions

I really like the short git log format where I can see author, date
Any suggestions on how I can cleanup the following code pattern that repeats multiple
How can I run a certain cleanup task after my Test target runs, regardless
Can a LINQ enabled app run on a machine that only has the .NET
I have a Moose class that i would like to store using Apache::Session::File. However,
Can the volatile be used for class objects? Like: volatile Myclass className; The problem
I have a cleanup scrip in a bat file and i wanted to do
Any recommendation on a C# utility (open source) that can can cleanup/delete aged files.
Can ruby lookup path to a binary like in bash or gnu makefile? Makefile
Under linux, you can rename a file with overwrite. For example, rename -f file_a

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.