Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,81 @@

## First Set
1. Create a new directory on your Desktop called git_exercises and cd into that directory.
mkdir git_exercises
cd git_exercises
2. Using `git init`, create a new repository.
git init
3. Using the `touch` command, create empty files called foo and bar in your repository directory.
touch foo
touch bar
4. Enter `ls` to make sure they were added.
ls
5. Check your `git status`.
git status
6. Using `git add foo`, add `foo` to the staging area. Confirm with `git status` that it worked.
git add foo
git status
7. Using `git commit -m` add an appropriate message, add foo to the repository.
git commit -m "add foo to repo"
8. Check your `git status`.
git status
(green bc it worked)
9. Using `git add bar`, add bar to staging area. Confirm with git status that it worked.
git add bar
git status
10. Now run `git commit -m` option, and add the message `“Add bar”`.
git commit -m "add bar to repo"
11. Using `git log`, confirm that the commits made in the previous exercises worked correctly.
git log


## Second Set

1. Use touch to create an empty file called baz.
touch baz
2. Check that it's there by entering `ls`.
ls
3. Check the status of your git.
git status
(red bc not committed yet)
4. Add baz to the staging area using `git add .`, then commit with the message `"Add bazz"`.
git add .
git status
(green bc it worked)
git commit -m "Add bazz"
5. Realizing there’s a typo in your commit message, change bazz to baz using `git commit --amend -m Add baz`.
git commit --amend -m Add baz
6. Run git log to get the id of the last commit, then view the diff using `git show <id>` to verify that the message was amended properly.
git log
git show <paste id>

### Third Set

1. The `git log` command shows only the commit messages, which makes for a compact display but isn’t particularly detailed. Verify by running `git log -p` that the `-p` option shows the full diffs represented by each commit. Press `q` to escape.
git log
git log -p
q to esc
2. Create a file `README.md`, add and commit it.
touch READ.ME
git add .
git commit -m "create file READ.ME"
3. Got to github and create a new repository. Connect your local repo to the remote one.
create new repo
git remote add origin <ngit remote add origin https://github.com/Wilsantos1975/new-repo.git>
git push -u origin master
click on new repository
4. Open your README.md and and add the line `# hello there` at the top of `README.md` and save.
opened READ.ME
add line # hello there
command s
5. Check the status, then add, check the status, and then commit the new line with a commit message of your choice. Verify using `git status` that the change was committed as expected.
git status
git add .
git status
git commit -m "finish git lab READ.ME"
6. Push your changes: `git push origin master`. Refresh your github and click on the commit to verify the changes.
git push origin master


### Fourth Set

Expand All @@ -41,7 +87,17 @@
For more information on Git, see the
[official Git documentation](https://git-scm.com/).
```
```
~/repos/website/README.md
For more information on Git, see the
[official Git documentation](https://git-scm.com/).
```

2. Commit your change with an appropriate message. Why not?
git status
git add .
git status
git commit -m "add markdown on READ.ME"

3. Push your change to GitHub. By refreshing your browser, confirm that the new line has been added to the rendered README. Click on the “official Git documentation” link to verify that it works.
git push origin master