- Check your branch (
git branch
) and your status (git status
) - Create new branch using the following pattern <your_last_name>_ccode_main (tip:
git checkout -b <branch_name>
) - Create new file called test.txt and fill it with one word(be careful, we gonna create a phrase)
- Add this file and commit it (
git add test.txt
git commit -m "your message"
). While doing it you can try git status to see the evolution of tracked files - Create a folder using the same pattern, that for your branch and fill it with random files.
- Add it and push(you must use
git add .
to add all files) - Use
git push --set-upstream origin <branch_name>
- Create new branch using pattern <your_last_name>_ccode_dev from the main branch that you are created (<your_last_name>_ccode_main)
git pull --rebase
to see other's modificationsgit checkout <your_last_name>_ccode_main
- Merge 2 of your COMRADES branches (
git merge
), good luck with conflicts git log --graph
is a very useful command- Push and switch to your
dev
branch. - Change something on your dev branch, then commit it and push
- In order to preserve linear repository you could make a rebase of your dev branch with your main branch
- Now you can merge your dev branch to your main branch
- Make an idiot commit and push on your main branch
- Now
git reset --hard HEAD~1
and check withgit status
git log --graph
_______ _______ __ __ __ ____ _____ ______
|__ __| __ \ \ / / | \/ |/ __ \| __ \| ____|
| | | |__) \ \_/ / | \ / | | | | |__) | |__
| | | _ / \ / | |\/| | | | | _ /| __|
| | | | \ \ | | | | | | |__| | | \ \| |____
|_| |_| \_\ |_| |_| |_|\____/|_| \_\______|
- Delete you dev and main branch for everybody (
git push --delete origin <branch>
) - Locally
git branch -D <branch>