Jump to content

entangled in GIT


ajoo

Recommended Posts

Hi all

 

Below is an image of my git with labels.

 

As you can see there are 3 branches and a master. I created the branch B3 from B2 and B2 from B1 but i guess for git all seem to come from the master ulimately ( I mean the trunk of the tree is common to all). 

 

The pen-ultimate commit comes from the production server. I then cloned that into my local machine where I wish to develop and test locally. That is the basic idea - to develop and test locally and then push to the repo. From there pull the changes to the server and run it there. Continue to develop and test locally and then push again to repo. Then pull the changes to the server and continue the cycle. 

 

So I made a small test change and pushed it to the repo. All is fine. However when I pull the branch into the server, it wants to merge B2 into B3 which is not what I intend to do. I just want to continue to develop along B3 and leave B2 alone where it is. Is this possible? Is there a better way to achieve what I am trying to?

 

Thanks all.

 

 8GEjSUG.png

Link to comment
Share on other sites

Sounds like you're testing in production.

 

I think I've said to use a branch before. If so I take it back. Don't do that.

 

Checkout detached branches.

$ git checkout --detach origin/B3
origin/B3 will reference a particular commit (currently b0aaaca) and that will get checked out. You won't be able to make commits or other changes, but in production that should be fine.
Link to comment
Share on other sites

hmm it says 

 

 

 

does not take a path argument

 

and not that it's an 

 

invalid reference

Could it be that it's considering origin/<branch_name> as a path (as echoed by the message ) which it seems not to allow?

 

Still stuck.

 

Maybe I should just delete the copy of the repo on the server and then try and get the detached head from the repo as you suggested. What do you think ?

 

Thanks.

Edited by ajoo
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.