Modify the structure of README.md

Instead of having exercises in their own separate section,
they are now part of the main topics sections.

This should make the learning process easier to follow
where users have both exercises and questions in the same
place.

In addition, added a couple of new questions & exercises
and modified existing scripts accordingly.
This commit is contained in:
abregman
2021-07-12 02:02:57 +03:00
parent dfbe979872
commit e54648d47f
12 changed files with 216 additions and 81 deletions

View File

@ -0,0 +1,19 @@
## Git Commit 01
### Objective
Learn how to work with Git Branches
### Instructions
1. Pick up a Git repository (or create a new one) with at least one commit
2. Create a new branch called "dev"
3. Modify one of the files in the repository
4. Create a new commit
5. Verify the commit you created is only in "dev" branch
### After you complete the exercise
Answer the following:
1. Why branches are useful? Give an example of one real-world scenario for using branches

View File

@ -0,0 +1,20 @@
## Git Commit 01
### Objective
Learn how to commit changes in Git repositories
### Instructions
1. Create a new directory
2. Make it a git repository
3. Create a new file called `file` with the content "hello commit"
4. Commit your new file
5. Run a git command to verify your commit was recorded
### After you complete the exercise
Answer the following:
* What are the benefits of commits?
* Is there another way to verify a commit was created?

View File

@ -0,0 +1,20 @@
## Branch 01 - Solution
```
cd some_repository
echo "master branch" > file1
git add file1
git commit -a -m "added file1"
git checkout -b dev
echo "dev branch" > file2
git add file2
git commit -a -m "added file2"
```
Verify:
```
git log (you should see two commits)
git checkout master
git log (you should see one commit)
```

View File

@ -0,0 +1,10 @@
## Git Commit 01 - Solution
```
mkdir my_repo && cd my_repo
git init
echo "hello_commit" > file
git add file
git commit -a -m "It's my first commit. Exciting!"
git log
```