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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:27:53+00:00 2026-06-14T15:27:53+00:00

I have a (large) Fortran project under Git. There are different active branches, corresponding

  • 0

I have a (large) Fortran project under Git. There are different active branches, corresponding to features under development. I would like to find a convenient way of maintaining a compiled version of the code for each branch.

The code is currently compiled using Make and all the object files are kept in a separate folder (like build_branch1) along with the binaries. The directory structure is like this:

Makefile
./src
./build_branch1/objects
./build_branch1/bin
./build_branch2/objects
./build_branch2/bin
…

In principle, I can therefore compile all the branches like this:

git checkout branch1
make –prefix=build_branch1
git checkout branch2
make –prefix=build_branch2
etc…

Make compares the timestamps of the sources (freshly checked out by Git) with the object files in the build_branchN folder and recompiles those that have changed. The problem is that Git changes the timestamps of all the source files that differ between branch1 and branch2, so that many files are re-compiled when they wouldn’t need to be. Since the code takes a long time to compile (up to 30 minutes), this can be a major inconvenience.

I was wondering what should be the best strategy in this case. I am thinking of updating the timestamps after each checkout, like in this post: What's the equivalent of use-commit-times for git?
What would you recommend?

  • 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-14T15:27:54+00:00Added an answer on June 14, 2026 at 3:27 pm

    Instead of modifying timestamp on each checkout, you could use a mechanism which wasn’t around at the time of those answers (including mine): git notes.

    You could:

    • after each build, a note the commit built with the build timestamp
    • before each build, look for a note (in a namespace named after the branch) for the last build timestamp and modify any file (which isn’t currently being modified, according to git status) with that timestamp.

    The idea is to record the information you need:

    • in the Git repo (so it can persists)
    • in a way which doesn’t change the current history (the SHA1 of the commits aren’t modified)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have large images displayed in a grouped tableview. I would like the images
We have large files with zlib-compressed binary data that we would like to memory
I have large number of files with .gif extension. I would like to move
We have a large solution in Visual Studio 2010 which comprises a Fortran exe
I have large project to analyse. How to use gcov or lcov for it.
If I have large set of data in an array from like this, 1
I have large sets of data but somewhere in columns there is missing data
Fortran: There are two large arrays of integers, the goal is to find out
I have a Fortran code like this: file1.f90 program myprog use func1mod do i=1,N
I have written a fairly large program in Fortran 90. It has been working

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.