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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:44:57+00:00 2026-06-05T13:44:57+00:00

Assume I am one of many developers working with git on a huge code

  • 0

Assume I am one of many developers working with git on a huge code project, which has an incredibly long compilation time.

Now, my personal day-to-day changes are usually limited, and the codebase is decently modular, which means that as far as my personal work is concerned, compiling from scratch is a price that only has to be paid once. Afterwards, I can recompile only the modules I modified.

On the other hand, I frequently have to fix bugs in (at least two) branches which reflect states of the codebase completely distinct from the branch I work on. Those two branches are indeed the result of work from the entire development team, and often have entire modules rewritten or added. Having compiled everything before pushing a bugfix is mandatory.

My first approach was to switch from my development branch every time a bugfix is needed, then clean, bugfix, recompile from scratch, push, switch back to the original branch, clean again, recompile – the delay for doing this is intolerable.

I then moved to keeping three separate checkouts of the codebase on my machine. This solves the “costly recompilation” problem (my changes in every branch are incremental again), but it makes the question “what am I developing on right now ?” more complex to answer (since it depends on the current directory), and it makes synchronization of these three copies complex (it multiplies all the routine push/remote update/pull commands I have to do by three).

A simpler solution would be to have the ability to save the state of a directory (untracked, where I generate compiled files) every time my checkout “leaves”a branch, and to recall the state of that directory, if it exists, every time I “enter” (checkout) a branch.

  • Are there git commands that would help me achieve this behavior ?
  • If not, is there a tool that would allow me to do that ?
  • If not, does git provide checkout hooks that could help me script this behavior ?
  • 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-05T13:44:59+00:00Added an answer on June 5, 2026 at 1:44 pm

    I would suggest to use stashes, they are pretty close to what you need.

    In recent versions of git, you can stash untracked files with the --include-untracked option. You can also give messages to your stashes and recall them, so you can check in which stash must be applied after checking out a branch.

    #before leaving branch
    git stash save --include-untracked "compiled stuff for my_branch"
    git checkout another_branch
    #what stash contains compiled stuff for another_branch?
    git stash list
    git stash pop stash@{n}
    

    You can script a bit to make things more practical…

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

Sidebar

Related Questions

Let's assume I have two models: A and B. A has one-to-many relationship with
Let's assume one joins a project near the end of its development cycle. The
I have two tables - 'business' and 'business_contacts'. The business_contact table has a many-to-one
I have a Good Practice Question: Lets assume a case where one have many
here's the description of my everyday work: Two developers working in many small features
Right now a project I'm working on has reached a level of complexity that
(For the purposes of this question, let us assume that one is intentionally not
Lets assume I have two hashes. One of them contains a set of data
Let's assume that I can't script the loaded swf, nor can the loaded one
Let's assume I'm developing a AJAX, PHP chess game. During the game, one movement

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.