I'm working in a multi-developer environment on a repository which has a branch called "develop", which is updated frequently. However, there's a few issues with develop, and I'd like to create a branch on my local machine, say "custom_develop", where I can make a couple of commits I don't intend to push back to the main repository.
When I work on a feature branch, I'd like to start off by creating a branch of custom_develop called "feature/ticket-123", and create a couple of commits. Then, when I think I've finished my work on ticket 123, I want to make "feature/ticket-123" become a branch of "develop" rather than a branch of "custom_develop", so that I can create a pull request which will merge into develop on the remote server.
How can I do this in git?
If I try doing
git checkout develop
git checkout -b custom_develop
git commit -m "Commit I don't want to share"
git checkout -b feature/ticket-123
git commit -m "Ticket-123: Refactor"
git rebase develop
I get
Current branch feature/ticket-123 is up to date.
and the git log still includes the "Commit I don't want to share" commit.