Add git Dev Branch
The goal of this post is to:
- Create a dev branch in git quickly to manage dev code before release
- Establish main branch as the system update branch
Update to the latest:
git fetch origin
If you already created and pushed dev from main, just do:
git checkout dev
If not yet created, do this instead:
git checkout -b dev origin/main
git push -u origin dev
Now you’re on
git add .
dev
. Add your changes, commit, and push:git add .
git commit -m "Start development on feature XYZ"
git push
Assumptions
- Code already exists in the main branch
- The main branch is already set up for releases, i.e. when code is pushed up
- Pull requests are done in addition to the instructions above, which start the live releases
Stop tracking specific files. For example, web.config should not be tracked. To remove it but keep it on your local machine, do this:
git rm --cached web.config
git commit -m "Stop tracking web.config"