Allow fetching a branch without checking it out

burbelgruff 2 months ago 0

I have a branch which is out of date with the server version.

I want to fetch the server code without switching to the branch.


We have a very large c++ application that takes ~2 hours to build. If you have done a major change in a common header, everything needs to be recompiled.

Say you have three branches:

1. develop

2. Feature 1

3. Feature 2

1. You have done some long-term development of a library i feature 2

2. You switch to Feature 1 and change a common header

3. You build and commit and integrate to develop.

4. You want to switch to Feature 2 and continue working on it.

Problem: The time stamp of the common header changes, and you are forced to wait 2 hours for the build to complete. This is also the case if you integrate from develop after you have switched to Feature 2.

Our current solution:

a. Push Feature 2

b. Clone repository into a backup location

In backup location:

c. Check out Feature 2

d. Integrate develop into Feature 2 (Resolve conflicts if necessary)

e. Push Feature 2

Go back to main repository

f. Now we want to fetch Feature 2 without checking out, we use the command line:

git fetch origin feature/Feature_2:feature/Feature_2

We want this operation to be more automatic. The first step is to automate step f, which is the only step we currently cannot use SmartGit to solve.