Answer the question
In order to leave comments, you need to log in
How to merge into a git-flow branch?
Briefly tell the situation:
1 - There is master -> README.md;
2 - Created a developer branch in the repository
3 - Created a developer branch in the feature -> feature_some1 branch
Problem:
1) On gitlab I see that I have master and feature/feature_some1 (BUT! no developer, it turns out that I didn’t push developer ?!) [Through git branch I see that there is a developer, that is, is it local?]
2) Now I wanted to merge feature_some1 to developer
(I get the error working tree contains unstaged changes. aborting. git flow)
[I understand that he does not want to merge, because are there any uncommitted files locally?]
Question:
1) How can I push deloper to gitlab/github ?
2) How can I create a new branch for feature_some2 ?
(Is it possible to do the same, so that feature would have both feature_some1 and feature_some2 ?)
[that is, now locally like this:
developer -> feature
feature -> feature_some1
want -> feature_some2
]
Answer the question
In order to leave comments, you need to log in
1) By default, git push sends only one branch to the server - the current one. To push the developer
branch , first switch to it.
Or you can not switch, but explicitly specify what and where to push .
This command says: take the developer branch and push it to the origin repository . The -u
flag is needed to immediately link local branches to the remote ones being created.
Although you can tell git to push all local branches at once
git checkout developer
git push -u
git push -u origin developer
% git push -u --all
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/.../repo.git
* [new branch] developer -> developer
Ветка «developer» отслеживает внешнюю ветку «developer» из «origin».
Ветка «feature/feature_some1» отслеживает внешнюю ветку «feature/feature_some1» из «origin».
Ветка «feature/feature_some2» отслеживает внешнюю ветку «feature/feature_some2» из «origin».
Ветка «master» отслеживает внешнюю ветку «master» из «origin».
% git branch
developer
feature/feature_some1
* feature/feature_some2
master
Do you need git-flow?
As far as I understand, you have almost no experience in git, but you are going to apply the enterprise solution right away. git-flow implies the use of releases . In this regard, a set of branches and their interaction is built. In the vast majority of cases, releases are not needed , which means the process will be different.
The simplified process was well described by an experienced person here: https://qna.habr.com/answer?answer_id=1552111#answ...
This works even if you have several people in your team, not to mention one developer. Checked on myself.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question