Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change naming of staging index to be consistent #180

Merged
merged 1 commit into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
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
32 changes: 16 additions & 16 deletions day1/03_Basics/03_Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

* `git add`
* Add new files to Git (staged)
* Add modified file(s) from the working directory into the staging index
* Add modified file(s) from the working directory into the staging area
* `-A` adds all files. Question: Where is this applicable?
* `git mv`
* Rename file(s) tracked by Git
Expand All @@ -12,7 +12,7 @@

****

`git add` will add the file(s) and their content to the staging index
`git add` will add the file(s) and their content to the staging area
waiting for the commit. This applies to both, new files and also modified
files.

Expand All @@ -34,7 +34,7 @@ manually move the file, you will need to rm and add it again.
* Steps:
* Change into `$HOME/training`
* Create README.md and add `# GitLab Training Notes` as first line
* Use `git add` to add README.md to the current change index
* Use `git add` to add README.md to the current change area
* Next steps:
* Verify the change with `git status`

Expand All @@ -53,7 +53,7 @@ in the `README.md` file.
!SLIDE supplemental exercises
# Lab ~~~SECTION:MAJOR~~~.~~~SECTION:MINOR~~~: Add a new README.md file

## Objective: Add a new README.md file to the current change index
## Objective: Add a new README.md file to the current change area
****

* Add a new README.md file
Expand All @@ -64,7 +64,7 @@ in the `README.md` file.

* Change into `$HOME/training`
* Create README.md and add `# GitLab Training Notes` as first line
* Use `git add` to add the file to the current change index
* Use `git add` to add the file to the current staging area
* Verify the change with `git status`


Expand All @@ -91,7 +91,7 @@ in the `README.md` file.
# Remove changes

* `git rm --cached`
* Reset files added to the staging index
* Reset files added to the staging area
* Hint: This comes in handy with `git add -A` before
* `git rm`
* Remove the file(s) from working tree and Git repository
Expand All @@ -101,26 +101,26 @@ in the `README.md` file.

****

`git rm --cached` resets files added to the staging index. You can also use it to
`git rm --cached` resets files added to the staging area. You can also use it to
reset commits from the history.

This also is helpful when you need to add 95 out of 100 changes. First, use `git add -A`
and then selectively unstage the unwanted 5 changes.

`git rm` removes the file from the working tree and also from the git index.
`git rm` removes the file from the working tree and also from the staging area.

~~~ENDSECTION~~~



!SLIDE smbullets
# Lab ~~~SECTION:MAJOR~~~.~~~SECTION:MINOR~~~: Reset File from Staging Index
# Lab ~~~SECTION:MAJOR~~~.~~~SECTION:MINOR~~~: Reset File from Staging Area

* Objective:
* Reset file from staging index
* Reset file from staging area
* Steps:
* Change into `$HOME/training`
* Remove the previously added `README.md` file from the staging index with `git rm --cached README.md`
* Remove the previously added `README.md` file from the staging area with `git rm --cached README.md`
* Verify it with `git status` and explain what happened
* Re-add the `README.md` and examine again with `git status`

Expand All @@ -131,28 +131,28 @@ and then selectively unstage the unwanted 5 changes.
~~~ENDSECTION~~~

!SLIDE supplemental exercises
# Lab ~~~SECTION:MAJOR~~~.~~~SECTION:MINOR~~~: Reset File from Staging Index
# Lab ~~~SECTION:MAJOR~~~.~~~SECTION:MINOR~~~: Reset File from Staging Area

## Objective: Reset File from Staging Index
## Objective: Reset File from Staging Area
****

* Reset file from staging index
* Reset file from staging area


## Steps:

****

* Change into `$HOME/training`
* Remove the previously added `README.md` file from the staging index with `git rm --cached README.md`
* Remove the previously added `README.md` file from the staging area with `git rm --cached README.md`
* Verify it with `git status` and explain what happened
* Re-add the `README.md` and examine again with `git status`

!SLIDE supplemental solutions
# Lab ~~~SECTION:MAJOR~~~.~~~SECTION:MINOR~~~: Proposed Solution
****

## Remove file from staging index.
## Remove file from staging area.

****

Expand Down
8 changes: 4 additions & 4 deletions day1/04_Commits/02_Commits.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Work on Git History

* `git commit`
* Selected changes from the staging index
* All changes (`-a`) not necessarily added to the staging index
* Selected changes from the staging area
* All changes (`-a`) not necessarily added to the staging area
* Verbose mode shows changes compared to latest commit (`-v`)
* Uses the configured editor (vim, nano, etc.)
* `-m` allows for a short commit message without editor view
Expand Down Expand Up @@ -31,7 +31,7 @@ requiring you to add a commit message.
* Steps:
* Change into `$HOME/training`
* Modify the `README.md` file and add more docs
* Add the change to the changing index
* Add the change to the staging area
* Commit the change to your Git history with `git commit -v README.md`
* Next steps:
* Use `git log` to verify the history
Expand All @@ -56,7 +56,7 @@ requiring you to add a commit message.

* Change into `$HOME/training`
* Modify the `README.md` file and add more docs
* Add the change to the staging index
* Add the change to the staging area
* Commit the change to your Git history with `git commit -v README.md`

## Next steps:
Expand Down
12 changes: 6 additions & 6 deletions day1/04_Commits/05_Amend.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Amend changes to commits

* Change the commit message, e.g. typos or missing changes broke the build
* Amend changes from staging
* Amend changes from staging area
* Helps if new files were added but not committed
* `git commit --amend` changes the latest commit
* Amending commits in Git history is possible, explained later with `git rebase`
Expand All @@ -26,8 +26,8 @@ problems in collaboration with others.
* Steps:
* Change into `$HOME/training`
* Modify `README.md` and add docs about amend
* Add `README.md` to the staging index and commit the change
* Edit `README.md` again and add it to staging
* Add `README.md` to the staging area and commit the change
* Edit `README.md` again and add it to staging area
* Use `git commit --amend README.md` and explain what happens
* Bonus:
* Adopt the commit message using `git commit --amend`
Expand All @@ -53,8 +53,8 @@ problems in collaboration with others.

* Change into `$HOME/training`
* Modify `README.md` and add docs about amend
* Add `README.md` to the staging index and commit the change
* Edit `README.md` again and add it to staging
* Add `README.md` to the staging area and commit the change
* Edit `README.md` again and add it to staging area
* Use `git commit --amend README.md` to add the change to the previous commit

## Bonus:
Expand All @@ -78,7 +78,7 @@ problems in collaboration with others.

`git commit --amend` adds missing changes to the previous commit.

### Add README.md to the staging index and commit the change
### Add README.md to the staging area and commit the change

@@@ Sh
$ git add README.md
Expand Down
2 changes: 1 addition & 1 deletion day1/05_Branching/03_Reset_Commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

* `git reset`
* Remove the current commit(s)
* `--soft` adds changes to the staging index
* `--soft` adds changes to the staging area
* `--hard` drops them
* Requires a new commit base specified with `HEAD` or any other pointer
* `HEAD~3` points to the 4th commit back in the history, resetting the latest 3 commits
Expand Down