Seminars
Seminar 1
- Initialize new repo locally.
- Create (or copy in) new script written in your favourite programming language.
- Start tracking your file in Git.
- Make multi-line changes to your code and commit them.
- Repeat 4th point 2 more times.
- Show difference between
main
and the first commit. - Make changes in 2 files, stage both at once, then remove them from staging index one by one.
- Revert the changes from the previous commit.
- Make .gitignore ignore all (make changes 1-by-1 and commit in between):
- 2 files you've created above and not commited (without writting their full/relative path)
- Files in
log
directory, which can be located in any subdirectory in your repository. - Files containing
_test
in root directory of your repository. - Any files with
6, 9, 1
as 2nd character.
- Demonstrate 3 types of resets.
- Create new branch called dev pointing to the same commit as main.
- Create additional branch called hotfix.
- Delete hotfix branch.
- Demonstrate 3 types of merging strategies:
- fast-forward
- recursive
- 3-way with conflict
- Create another branch starting from the 1st commit in your repository.
! don't delete the repository after you are finished!
Seminar 2
- Create new (public) repository on GitHub.
- Clone this repository to your local machine.
- Make one commit locally.
- Get difference between state of your local and remote repos.
- Push your changes back to the remote.
- Create new branch locally.
- Add new file and commit it.
- Create new branch on GitHub (named differently than the branch you've created in the previous step).
- Add new file named the same as file created locally in step 6. (still in GitHub)
- Make content of the file "conflicting" with content of the file created locally in step 6.
- Push local branch (from step 6) to the remote.
- Pull remote branch (from step 7) to your local machine.
- On your local machine, merge the branch you've pulled from remote (from step 7) to your local branch (from step 6).
- Solve merge conflicts (if any).
- On your local machine, merge the branch from step 10 to your main branch.\
- Add some new file and commit it.
- Push your main branch to remote.
- On GitHub, merge the branch you've pushed from local (from step 6) to your remote branch (from step 7).
- (hint: create a pull request first)
- Create an issue in your GitHub repository for your colleague.