fleetingbytes
fleetingbytes

Reputation: 2992

How to maintain multiple branches of a repository?

I use a repository on github.com to maintain my personal configuration of the FAR Manager, an orthodox file manager. I use it on my home computer and on the work laptop. Their FAR Manager configurations (profiles) differ slightly because of other programs' paths, drive names, folder shortcuts, etc. but they share a great deal. From time to time I install a plugin or find a configuration which I'd like to share globally across profiles.

Basically everything specific to my home or work configuration is in the /MyProfile/Home subfolder or /MyProfile/Work subfolder respectively.

I don't know exactly what would be the best practice about backing-up all my computers' local configurations at the remote master repository on github.com.

I think maybe I want to maintain two branches of this repository on github.com for a long term. A branch Home and another branch Work whereto I would push the current configuration from my home or work computer respectively. But if there is better ways to do it, I welcome any suggestions.

So far, at my home computer, I cloned the remote master repository and then I created a branch home

git clone <github url>
git branch home
git checkout home
git push --set-upstream origin home

and at my work laptop I cloned the master repository and then I created a branch work

git clone <github url>
git branch work
git checkout work
git push --set-upstream origin work

But now I don't know anymore how to push the commits. Would a simple git push be enough or do I need to do things differently?

Upvotes: 1

Views: 1412

Answers (1)

kevinj
kevinj

Reputation: 285

Having separate branches for home and work would be fine as long as you will start creating additional branches , for any future update, from these and not from master. In other words you will end up having a master branch for home and another master branch for work. Any push should be made to children branches of these ones. And PRs should be made against one of these branches (work or home).

Alternatively, you could consider to have a single master Branch and having just two folders home and work. Mostly would depend on your setup.

Upvotes: 2

Related Questions