1

I am using EAGLE CAD with git for revision control. EAGLE stores its files as xml. I have different board revisions and I tag them with annotated tags so I can check out the revision whenever I want to view it.

Most users will find that a diff will be sufficient to compare two commits, but it would be much more illuminating for me to be able to open two files with EAGLE to visually compare them.

I am aware that there is some software out there for this specific application, but I just want to know how to checkout two commits of the same file into the working directory.

2
  • 2
    git show commit:path/to/file >oldcopy_of_file Commented Jan 15, 2014 at 18:20
  • @jthill, please turn it into an answer as it's the only sensible thing to do (other than the contrib new-worktree script which is too heavy-weight for this simple task). Commented Jan 16, 2014 at 10:23

2 Answers 2

1

One file:

git show $commit:path/to/file.xml > mycopy.xml

All the files, clone is built for this, it's dirt cheap:

git tag oldcommit $commit
git clone --branch oldcommit ../oldcommit
git tag -d oldcommit
Sign up to request clarification or add additional context in comments.

Comments

0

Here is a primitive approach.

git checkout otherCommit file.xml
cp file.xml file.1.xml
git checkout anotherCommit file.xml
cp file.xml file.2.xml

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.