Init branch,. Create a new working branch in local. Edit files. Commit your changes. Repeat. And deploy
Init branch
Check other available branche.
git branch
It shows us only master.
Check other branches.
git branch -a
-a show us the hidden branches
To clone the other branches (needed to merge)
git checkout -b {branchName} origin/{branchName}
You are automatically positioned on branch {branchName}.
Dev branch
- Branch
Create a new branch in local
git branch dev-{featureName}dev-{featureName} the branch where you will work
Switch to the dev branch
git checkout dev-{featureName}how to display the branch where your are working in, see tricks
- sdfdsfsdf
- Edit your files and commit your changes
Commit changes
This is the iterative commandos :
git status > git add modified:fileX > git commit -m 'message'
Check if files are modified or added
git status
Check the differences, if everything OK
git diff {file1} {file2} {fileX}if everything OK go ahead.
Add files
- Check status
- Commit to the branch