Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • thg thg
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 838
    • Issues 838
    • List
    • Boards
    • Service Desk
    • Milestones
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • mercurial
  • TortoiseHg
  • thgthg
  • Issues
  • #4982

Closed
Open
Created Dec 20, 2017 by Bitbucket Importer@bitbucket_importerOwner

Ammending commit doesn't want to remove (parts of) files

Created originally on Bitbucket by Mojca Miklavec

I often make the mistake of forgetting to uncheck some files before commiting. I realize this after clicking the "commit" button, but before pushing to a public repository and I would like to remove a couple of files from that commit before making the commit public.

The "Ammend" functionality works perfectly when I forget to add some files. I can then just add the missing bits and pieces and click Ammend. But the same doesn't work when I try to remove files. Tortoise just tells me that there's nothing to commit.

I then spent quite some time trying to figure out how to properly do this from the command-line. I didn't find a straightforward way yet. A lazy-man approach for me in git would usually be "git reset HEAD~1" which would undo the last commit without modify the files and then repeat the commit steps themselves again (I would need to retype the). After a lot of searching I figured out the mercurial equivalent being "hg strip --keep ." I also spent quite some time time trying to figure out how to do that in TortoiseHG, but without any success yet. That's a different issue or perhaps a feature request in case it's not yet implemented.

But being able to remove files from the last commit would be super super useful.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking