1

I am working on an ant project which I am downloading from git, and need to focus on a particular commit.

It may sound like a basic question, but I was wondering whether it made any difference whether I compiled first or used the checkout command first.

I assume I should checkout first...?

Thanks :)

Anshul Goyal
  • 61,070
  • 31
  • 133
  • 163
MrD
  • 4,517
  • 9
  • 40
  • 78

1 Answers1

2

Yes, you should checkout that particular commit first, because otherwise, the classes to be compiled will not be corresponding to that commit (as they might have been updated in subsequent commits).

Once you have made sure that your code is corresponding to that particular commit, you can compile your ant project.

To create a new branch corresponding to a specific commit, use

git branch branchname <sha1-of-commit>
git checkout branchname

Or for a single step solution

git checkout -b branchname <sha1-of-commit> 
Community
  • 1
  • 1
Anshul Goyal
  • 61,070
  • 31
  • 133
  • 163