-
Notifications
You must be signed in to change notification settings - Fork 3
Creating branches and branch management
You need to pull changes before creating new branches or you will be behind. Enter the following command then continue:
git pull
Type in the following command in git bash or wsl, for example:
git checkout dev
You will create a feature branch for the specific feature or thing you are working on. To create your branch enter the following command:
git checkout -b dev-featureName dev
*this command creates new branch and branches off of dev branch
To have your branch show up on GitHub and allow others to work on it you have to set it upstream. Enter the following command while you are in your new branch:
git push --set-upstream origin dev-<feature-name>
Now you are good to go a simple command:
git push
Will push you changes to your remote feature branch and from GitHub you can create a pull request to merge your changes into your dev- branch as you complete your feature.
If you want to delete your branch use the commands below to delete locally and remotely:
Local Delete: git branch -d dev-featurename
Remote Delete: git push origin --delete dev-featurename