Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to work on a file that's on a branch other than the current branch without explicitly switching to that branch?

I have an orphan branch that consists of notes, and another branch where I have my code. I'd like to have an editor constantly open for edit with a file from the notes branch, as well as another editor session open for coding with files from the development branch. Normally I'd have to keep switching back and forth between the branches whenever I want to commit. I wonder if there's a tool that supports this workflow by knowing to commit a file to its respective branch.

share|improve this question
Please raise your accepting rate. Why would we care about your questions if you don't care about our answers. See and… – JMax Jan 2 '12 at 19:33
up vote 3 down vote accepted

If you create another repository and pull the notes branch into it, then you can work on your notes branch in the second working directory

cd ~/project
git checkout notes
git clone ~/project ~/project-notes
cd ~/project-notes

After this, you can edit your notes in the ~/project-notes directory and edit the files in the ~/project directory. Simply pull the notes branch back into ~/project occasionally.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.