Skip to content

Commit

Permalink
Added more lessons: git basic/advanced commands, gitlab, clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan Popescu committed Nov 19, 2024
1 parent ccda737 commit d83fe94
Show file tree
Hide file tree
Showing 7 changed files with 1,913 additions and 6 deletions.
3 changes: 3 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ contact: '[email protected]'
# Order of episodes in your lesson
episodes:
- version_control.Rmd
- basic-git-commands.Rmd
- gitlab.Rmd
- advanced-git-commands.Rmd
- python-virtual-environmants.Rmd
- qsmm.Rmd
- clean-code.Rmd
Expand Down
52 changes: 52 additions & 0 deletions episodes/advanced-git-commands.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: 'Advanced Git Commands'
---

:::::::::::::::::::::::::::::::::::::: questions

- How can I use version control to collaborate with other people?
- What do I do when my changes conflict with someone else's?

::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::: objectives

- Clone a remote repository.
- Collaborate by pushing to a common repository.
- Describe the basic collaborative workflow.
- Explain what conflicts are and when they can occur.
- Resolve conflicts resulting from a merge.

::::::::::::::::::::::::::::::::::::::::::::::::

## Collaborating

- Clone a remote repository setup in GitLab for this course
- Make changes to a file, commit, and push back to GitLab
- Introduce the basic collaborative workflow:
- git pull
- make changes
- git add/commit
- git push
- Reviewing and commenting changes in GitLab

## Solving Conflicts
- Explain when and why conflicts occur
- Explain how conflicts can be solved through a merge cycle
- Techniques to minimize conflicts:
- Pull from upstream more frequently, especially before starting new work
- Make smaller more atomic commits
- Where logically appropriate, break large files into smaller ones so that it is less likely that two authors will alter the same file simultaneously
- Clarify who is responsible for what areas with your collaborators
- Discuss what order tasks should be carried out in with your collaborators so that tasks expected to change the same lines won’t be worked on simultaneously



::::::::::::::::::::::::::::::::::::: keypoints

- `git clone` copies a remote repository to create a local repository with a remote called `origin` automatically set up.
- Conflicts occur when two or more people change the same lines of the same file.
- The version control system does not allow people to overwrite each other's changes blindly, but highlights conflicts so that they can be resolved.

::::::::::::::::::::::::::::::::::::::::::::::::

Loading

0 comments on commit d83fe94

Please sign in to comment.