S
S
sojik2014-10-24 17:54:29
git
sojik, 2014-10-24 17:54:29

How to properly work with the feature branch in git in order to regularly pull updates from the main one?

Colleagues, I ask for help, I can’t figure out how to put my work process in the right direction. I am participating in a project in which, let's say, I write only one feature in a separate branch - feature. Moreover, for certain reasons, the main developers do not want to take my feature for a long time. And during my work, let’s say 100 commits accumulate in their develop branch, which I also need for work. And there is a second important condition that I work from two places - from home and from the office, so I need to push my branch constantly to the server so that I can always have access to the latest changes from home and from the office. Well, after I take the changes from develop for myself, they may again decide not to take me to development for another week, and I will again need to take something from it.
Once lead says, they say, take our changes from the develop branch to yourself via merge rebase. It's a pain to do this, since I already pushed all my changes (for home-office work), and when I do a rebase and then push again to continue working at home, the remote reasonably does not want to accept this and has to force it. And at home, he also doesn’t want to pull, since the commits in the local version are also not the same. But it's all costly, but not nice to do often.
As far as I understand, my “comfortable” way of working does not involve rebase, and the most reasonable thing is to just periodically merge the develop branches into my feature, continue working and push my branch to the server.
In this regard, the question is:
1. Will the main developers then have big problems with my branch, which they eventually go to develop, since my branch will be an alternation of my commits from those taken from develop and will everything merge later.
2. Maybe I do not understand something correctly and tell me how to do it right
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Tyranron, 2014-10-24
@sojik

If you regularly merge the current develop into your branch, then you solve conflicts as they arise, so when you merge your branch into develop, there shouldn’t be any big problems, it will even be a banal fast-forward, if by relevance we mean the last commit in develop.
Rebase why do it here is not clear, except that "I want a cleaner history", but in this case, you can also merge the feature into develop after its implementation via git merge --squash.
My advice: the usual merge develop'a into your branch, the more often, the better (it will be easier to resolve conflicts).
Actually, you said it yourself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question