I am working on a project and some other developers also part of this project and we keep our works in Git.
According to the Create and merge a git branch to an epic branch question, On top of this, I have some other questions as well. I am following the below way to commit my changes,
created my branch feature/myVersion from the epic branch feature/version-1 and doing my implementation. Before I commit to the epic branch if another developer merged a feature branch to the epic branch before I commit and merge my branch to epic. I am doing the following to update my branch with epic. Is it the correct way?
git stash (stash my local changes)
=>Do I really need to fetch here. If yes why?
git rebase origin/feature/version-1
=>Do I really need to push here. If yes why?
git stash apply
git add .
git commit -m ""
git push origin feature/myVersion
and also I always create a new branch from the epic branch when I create a new feature of this epic branch. Is it the correct way or create a new branch from the branch is correct(For example create a feature/myVersion-1 branch from feature/myVersion branch or feature/myVersion-1 from the epic branch feature/version-1 is correct?)