TigerCoding
TigerCoding

Reputation: 8720

Can't push feature branch in git, doesn't exist in remote?

I created a feature branch off of develop. It looks like this:

feature

Previously when I made a feature branch, it also showed up on the remote, but now it's not present. Now, when I try to push in SourceTree, I get the following error:

To https://[email protected]/mycompany/projectname.git
 ! [remote rejected] feature/data_utilities -> feature/data_utilities (failed to write)
error: failed to push some refs to 'https://[email protected]/mycompany/projectname.git'

I also tried the command line...

git push origin feature/data_utilities

...but I got the same results. When I look on BitBucket, the feature branch doesn't exist.

Upvotes: 2

Views: 2233

Answers (1)

grenierm5
grenierm5

Reputation: 186

I don't use BitBucket, but the process for creating a feature branch from the command line is very simple.

git checkout develop
git checkout -B feature_branch
  # This command creates a new branch and switches context to the newly created branch
git push -u origin feature_branch
  # This will create the branch on origin and set it up to be a tracking branch

Upvotes: 2

Related Questions