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

  • Home
  • SEARCH
  • 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 163785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:37:41+00:00 2026-05-11T11:37:41+00:00

I use git to interface with an SVN repository. I have several git branches

  • 0

I use git to interface with an SVN repository. I have several git branches for the different projects I work on.

Now, whenever I switch from one branch to another using ‘git checkout ‘, all the compiled executables and object files from the previous branch are still there. What I would like to see is that switching from branch A to B results in a tree with all object files and binaries from the last time I worked on branch B.

Is there a way to handle this without creating multiple git repositories?

Update: I understand that executables and binaries should not end up in the repository. I’m a bit disappointed in the fact that all the branching stuff in git is useless to me, as it turns out I’ll have to clone my proxy git repository for every branch I want to start. Something I already did for SVN and hoped to avoid with git. Of course, I don’t have to do it, but it would result in me doing a new make most of the time after switching between branches (not fun).

  • 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. 2026-05-11T11:37:42+00:00Added an answer on May 11, 2026 at 11:37 am

    What you want is a full context, not just the branch… which is generally out of scope for a version control tool. The best way to do that is to use multiple repositories.

    Don’t worry about the inefficiency of that though… Make your second repository a clone of the first. Git will automatically use links to avoid having multiple copies on disk.

    Here’s a hack to give you want you want

    Since you have separate obj directories, you could modify your Makefiles to make the base location dynamic using something like this:

    OBJBASE = `git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1\//'` OBJDIR = '$(OBJBASE).obj' # branch master: OBJBASE == 'master/', OBJDIR == 'master/.obj' # non-git checkout: OBJBASE == '', OBJDIR == '.obj' 

    That will but your branch name into OBJBASE, which you can use to build your actual objdir location from. I’ll leave it to you to modify it to fit your environment and make it friendly to non-git users of your Makefiles.

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

Sidebar

Ask A Question

Stats

  • Questions 103k
  • Answers 103k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer WITH cte AS ( SELECT *, NTILE(100) OVER (ORDER BY… May 11, 2026 at 8:24 pm
  • Editorial Team
    Editorial Team added an answer Looking at the jQuery source code, this is all $.getJSON… May 11, 2026 at 8:24 pm
  • Editorial Team
    Editorial Team added an answer I hope it's not to late for my answer. As… May 11, 2026 at 8:24 pm

Related Questions

I have a home project that really needs to be in Source Control. I
I've done some work for a personal project of mine, and now I understand
Is there a way to add a Subversion repository as a Git submodule in
I have a simple blog application written in Python, using Django. I use Git

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.