2. About me
● Damascus University, Computer Science graduate.
● Majored in AI.
● Software Developer since 2018.
● Maintains some hobby projects on GitHub: @Reslan-Tinawi
3. Agenda
1. What is version control
2. What is Git
3. Installing & setting up Git
4. Setting up a repository
5. Saving changes (in Git world)
6. Git for team collaboration
7. Syncing repositories.
Note: this is a practical-focused workshop, I will be sharing my screen and do
demos.
4. Version control motivation
- Tracking and managing changes to software code.
- Keeps track of every modification to the code.
- A complete long-term change history of every file.
- Facilitating team collaboration on the same project.
- Source
5. What is Git
- Most widely used modern version control system in the world.
- Distributed Version Control System.
- Every developer's working copy of the code is also a repository that can
contain the full history of all changes.
- Git is a “de facto” standard in the Software World.
- Source
7. Installing Git
- Won’t be covered in detail here.
- It’s an easy process.
- Follow this guide.
- Git ssh setup:
- Generating a new SSH key
- Adding a new SSH key to your GitHub account
8. Setting up a repository
- Initializing a new Git repo
- git init
- git remote add <remote_name> <remote_url>
- Cloning an existing Git repo
- git clone <repo_url>
9. Saving and tracking changes
- Saving changes in Git is a little different from saving in a word processor.
- Add changes to staging area.
- git add
- “Commit” changes.
- git commit -m "commit message"
- Push changes to remote repository.
- git push <remote> <branch>
10. Git collaboration
- What are branches, and why do we need them?
- Imagine you are working on more than one task:
- Introducing a new feature.
- Fixing bugs.
- Experimenting ideas.
- Keep the master branch clean and stable.
- Branches represent an independent line of development.
13. Git collaboration (cont’d).
- Integrate changes in your feature/fix branch in the master branch.
- Pull requests: makes it harder for unstable code to get merged into the
main code base
- It’s best practise to perform code preview, before merging.
15. Syncing changes
- Upload local changes to remote repository.
- git push <remote> <branch>
- Download changes from remote repository.
- git pull <remote>
16. Your turn
1. Create a GitHub account: the easiest step.
2. Create SSH key: might have some troubles, ask for help on Slack.
3. Start using git for your projects:
a. Initialize new or existing project.
b. Or clone a repository.
17. Good resources to learn more
- Atlassian Git tutorials
- GitHub Guides