Git workflow idea to direct incomplete local branch to remote for backup purposes

Let's say that I am currently working on a new function that I have separated from the dev branch, and I have been working for several days, and it is not yet ready to merge with dev and is pressed.

Although I made several commits and pulled for changes to dev, and then changed dev to my function branch to keep myself in the know.

Here is my question. Is it a good idea to push my property branch to a new branch (with the same name as my local branch), to the beginning (like GitHub) for backup purposes only, and later when it merged with 'dev' and / master ' remove it from the source.

+4
source share
3 answers

Each developer must have their own clone repository. Thus, they can branch out and tag, as well as whatever they want, and have a backup at a remote location.

When a developer modifies QA'ed and is approved for publication, they must be merged into a master repository , even if they are in a different branch.

Thus, you have a local / remote copy of all your changes in all branches, but only completed / approved changes make it to the production repo, since this is a merge, the entire commit history is included and you get a good workflow.

+5
source

That sounds reasonable.
If no one pulls from this branch, I would recommend reinstalling your function branch on top of dev instead of merging dev directly into the function.
This can avoid a dirty story (if several functions are created on Dev)
But aside from this detail, dragging it to the GitHub repository is a viable workflow (if no one is trying to pull and merge this branch, that is, the naming is so well coordinated).
If your GitHub repo is a fork of the main project, you can finally push your own branch and delete it later.

+2
source

I see no harm in returning to my own remote repository for backup purposes, but if you build function branches large, you can study your development methodology:

Perhaps you create too much at once and need to break up the function that you develop in your function branch into several smaller tasks. This will simplify merging into your development branch.

0
source

Source: https://habr.com/ru/post/1310268/


All Articles