hitygcjctyfckgiktyujvtug
For a thorough discussion on the pros and cons of Git compared to centralized source code control systems, see the web. There are plenty of flame wars going on there. As a developer, I prefer Git above all other tools around tody. Git really changed the way developers think of merging and branching.
From the classic CVS/Subversion world I came from, merging/branching has always been considered a bit scary (“beware of merge conflicts, they bite you!”) and something you only do every once in a while.
But with Git, these actions are extremely cheap and simple, and they are considered one of the core parts of your daily workflow, really.
- Create your account with GitHub
- Clone this repository
- Create a pull request
- Review and peer review
- Fork this repository
- Manage conflicts
- Create a Wiki
- Create your personal page
-
If you don't have one, create a Microsoft account.
-
Go to Azure DevOps and select Get started with Azure.
-
Select either Try Azure for free or Pay as you go.
-
Enter your Microsoft account credentials and go through the sign-up process. Azure DevOps creates an organization:
- If you signed up with a newly created Microsoft account, Azure DevOps creates a project named after your account.
- If you signed up with an existing Microsoft account, create a project next.
Sign in to your organization at any time:
https://dev.azure.com/{Your_Organization}.
- GitHub desktop
- Sourcetree simplifies how you interact with your Git repositories so you can focus on coding. Visualize and manage your repositories through Sourcetree's simple Git GUI.
- Visual Studio Code
- Visual Studio
- GeeksforGeeks: Offers simple Git exercises, practice questions, and solutions suitable for all skill levels.
- WebUtility.io: Provides a Git Simulator for hands-on practice with Git commands and workflows directly in your browser.
- Git Exercises: A dedicated platform to learn and practice Git with various exercises. These resources will help you level up your Git knowledge effectively!
Students will collaboratively build a short story using Git. Each student contributes a paragraph, practices branching, merging, and resolving conflicts.
- Each student should have Git installed and access to GitHub or another Git hosting service.
- Instructor creates a public repository called collaborative-story.
- Clone the Repository
git clone https://github.com/erossini/GitExercises.git
cd GitExercises- Create a New Branch
Each student creates a personal branch:
git checkout -b student-name-story- Add a Paragraph
Edit the file story.txt and add a paragraph at the end.
- Commit the Change
git add story.txt
git commit -m "Added my paragraph to the story"- Push the branch
git push origin student-name-story- Create a Pull Request
Students open a pull request to merge their branch into main.
- Review & Merge
Peers review the pull request and merge it.
- Conflict Resolution (Optional Challenge)
If two students edit the same line, Git will show a conflict. Instructor can simulate this and guide students through resolving it:
git pull origin main
# Resolve conflict in story.txt
git add story.txt
git commit -m "Resolved merge conflict"- Go to your GitHub account and click "New repository".
- Name the repository exactly the same as your username.
Example: If your username is
erossini, the repo name should beerossini.
The repository must be public for the README to show on your profile.
GitHub will automatically detect this and display the README on your profile.
You can use Markdown to add:
- Text ✍️
- Images 🖼️
- Links 🔗
- Emojis 😎
- Badges 🚀
Example:
# Hi, I'm Enrico 👋
- 🔭 I’m currently working on open-source projects
- 🌱 Explaining GitHub
- 📫 Reach me at [My Website](https://puresourcecode.com)
