Git branching question

Hi everyone! I’m recently diving more in depth into git and I’m currently fighting with branching. All I want to do is this:

Assuming I just finished working on the shoot-system feature branch of the Realm Rush game , I commit the work and merge it back to the develop branch. Then i branch again form “develop” into a new feature branch called “enemy-spawner” to work on (guess it) the EnemySpawner class.

I work on the enemy spawner for a bit and i end up in a situation like this:

Now, what I’d like to do is to further improve the shooting system working into its own branch, BUT including the changes i’ve made while working in enemy-spawner.

Hope this is clear enough. Can someone help me with this?

Thanks alot.

Hi Manup,

I’m not sure if I understood your goal correctly. What I understood is: You merged the branch with the shooting system into the master branch. Then you created a new branch for your enemy spawner.

Now you want to continue working on the shooting system but you also want to have your enemy spawner included. Why don’t you merge the enemy spawner into your master branch and create a new branch for working on your shooting system after the merging?

Sorry, I prematurely replied by mistake :sweat_smile:

Hi Nina, thanks alot for your reply!

you want to continue working on the shooting system but you also want to have your enemy spawner included

Yes, my goal is exactly that, but I’d like to know if there’s a way to do that without merging to the master first. Is this useless or could it help with repository “tidyness”?

Maybe something like described in this answer?

Before experimenting around with merging, do yourself a favour and make a backup of your entire project folder by duplicating it before you test anything. Better safe than sorry. :slight_smile:

1 Like

Thank you, I’ll try to understand the contents in that page (not sure i will in a short time though) :confused:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.