### check current working brach
$ git status
# On branch master
nothing to commit (working directory clean)
### create new feature branch
$ git branch feature/new-cool-feature
### get on that branch
$ git checkout feature/new-cool-feature
### now make your changes to implement new cool feature
### when done, see the changes
$ git status
### add, commit and push
$ git add .
$ git commit -m "new features are cool"
$ git push --set-upstream origin feature/new-cool-feature
### in theory, your branch is tested by other developer or integrated into test site
### if it passes, now it is time to merge it into master branch and get ready for main deploy
$ git checkout master
$ git merge feature/new-cool-feature
$ git push
### at this point you have your new feature branch merged and pushed into remote master branch. Presumably, you have some type of CI checking for changes on that branch and doing delopments
### optionaly, you can delete your feature branch
$ git branch -d feature/new-cool-feature
No comments:
Post a Comment