Ken Y-N
Ken Y-N

Reputation: 15008

In repo workflow, what does it mean when my git branch and origin branch don't match?

When I do git status I see something like this:

On branch feature/my_new_feature
Your branch is up-to-date with 'origin/develop'.
nothing to commit, working directory clean

I'm using repo, and I kicked off this feature with repo start feature/my_new_feature, but I was expecting it to be based on origin/feature/feature_release, which is the branch we do our development on, and I hoped using repo meant I wouldn't have to jump into git to patch up basic things like branches...

We're all a bit new with repo here, so there's a good chance the project has been set up wrongly; where's the best place to start looking?

Upvotes: 0

Views: 91

Answers (1)

ElpieKay
ElpieKay

Reputation: 30888

In the manifest file, the project has a default or specified revision or upstream. In your case, it's develop. repo sync is nearly equivalent to git checkout --detach <revision> and it leads to detached HEAD. repo start feature/my_new_feature creates a named branch feature/my_new_feature from <revision> and sets origin/develop as its upstream, equivalent to git checkout -b feature/my_new_feature origin/develop && git branch -u origin/develop.

If you expect the upstream in git status to be origin/feature/feature_release, you should either specify the project's attribute revision or upstream in the manifest file as feature/feature_release, or use git checkout -b feature/my_new_feature origin/feature/feature_release && git branch -u origin/feature/feature_release in the repository. In the former way feature/feature_release should already exist in the remote repository, and in the latter origin/feature/feature_release should already exist in the local repository.

Upvotes: 1

Related Questions