Introduction
- Excellent Git tutorials exist.
- Take your time to work through them.
Undoing things locally
- Git command outputs are helpful, in particular,
git status
. - Git is a powerful tool with a solid documentation.
Undoing things once pushed
- Once commits have been pushed to the remote repository, make your changes so that the commit history is kept - unless you want to modify it.
Working together
- If the use of automated workflows is planned, it is convenient to work in a shared repository instead of using forks.
- You will use branches to contribute to the shared repository (unless you are the owner or the maintainer).
Resolving conflicts
- Git is the tool for managing collaborative work on code.
- Git automatically integrates changes when it’s safe, and asks you to resolve things when there’s a conflict.
- Conflicts are not errors—they’re a normal part of working with shared code. But resolving them is an extra step for developers or maintainers.
- Merging your work into the default branch regularly prevents large conflicts and saves effort.
Keeping things in order
- Issue tracker in GitLab is a convenient tool for a centralised discussion for code development in a repository.
- Issues are helpful for tracking the progress and sharing the work.
Automate testing
- GitLab CI/CD pipelines are useful to test the functionality of the code updates.
- They can perform decicated tests or procude a sample output which can indicate that the code works as expected.