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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:28:45+00:00 2026-06-05T16:28:45+00:00

I simply want to edit some commits with git rebase -i HEAD~2 inside the

  • 0

I simply want to edit some commits with git rebase -i HEAD~2 inside the current branch.
I use Ubuntu 10.10 and had to install gvim first to make the command work.
Afterwards, the command opens a gvim window with the normal rebase content.
But when I want to save the file gvim says

“.git/rebase-merge/git-rebase-todo” E212

[Cannot open file to write]

Also the rebase command finishes right after starting (with Successfully rebased and updated refs/heads/master.).

  • When doing the same command with sudo the rebase works, but afterwards it occurs that files are owned by root and I have no write permissions anymore.

  • On my ArchLinux system gvim is opened directly in the terminal where I run git rebase -i and everything works.

  • I tried different terminals (Gnome terminal, LXTerminal, XTerm) – always the same problem

What is the problem here and how to solve it? It should work without sudo.

Edit 1

  • Some files in .git/... are owned by root and are read-only. All directories and files in the first level of .git/ are owned by me. With ls -l --recursive .git/ | grep root I tried to detect which files that are but the output does not give the paths of the files…
  • Should all files in .git/ belong to the user? May this be the reason for the problem?

EDIT 2

  • Even after changing ownership and write permissions of all files inside .git to user with sudo chown -R user:user .git/ and chmod u+w -R .git/ (ls -l now shows sth. like -rw-r--r-- 1 user user) the problem stays the same.
  • 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-06-05T16:28:46+00:00Added an answer on June 5, 2026 at 4:28 pm

    My solution was:

    Run

    $ git config --global core.editor "gvim -f"
    

    First, I thought it was because my repository was on an ntfs drive so the file permissions wouldn´t work correctly. But even after mounting the drive with correct file permissions the problem stayed the same. Starting vim with the -f option helps (I read about other people solving it the same way), but I don´t know why.

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

Sidebar

Related Questions

I'm currently writing some groovy scripts. Till now I simply use notepad and run
I'm struggling to think of a good way to use linq2sql, simply I want
I simply want to add some Javascript checks when an item is inserted or
Some background: I have an database that I want to use linq-to-sql to update
I want to edit some legacy code written in classic-ASP. Currently I've got a
I have a simple in-line edit in my grid, and I want to commit
Play with it here: http://jsbin.com/ocicu4/4/edit Simple Accordion, I only want one section open at
I simply want to fill-up cells in my spreadsheet from a VBA function. By
I simply want to show off a model in a table that is paginated
I simply want to change a variable of an object from another class. I

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.