Creating and doing changes on branches in Git repository
- Go to your project directory or git repository
- Lets create a branch
git checkout -b development
This command will create a development and copy all files from master branch - List of all branch
git branch
- Switch across branch
git checkout master
- Now lets switch back to development branch
git checkout development
- Lets do changes and commit them
echo "Development Code" >> app.py
- Adding and committing the changes
git add .
git commit -m "Updated development code"
- You switch back to master and check app.py file it wont have development code