Skip to content
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
30 changes: 16 additions & 14 deletions episodes/14-collaboration-using-git.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,26 @@ The diagram below shows a typical software development lifecycle with Git
(in our case starting from making changes in a local branch that "tracks" a remote branch) and the commonly used commands to interact
with different parts of the Git infrastructure, including:

- **working directory** -
- **working tree** -
a local directory (including any subdirectories) where your project files live
and where you are currently working.
It is also known as the "untracked" area of Git.
Any changes to files will be marked by Git in the working directory.
If you make changes to the working directory and do not explicitly tell Git to save them -
It is also known as the "untracked" area of Git or "working directory".
Any changes to files will be marked by Git in the working tree.
If you make changes to the working tree and do not explicitly tell Git to save them -
you will likely lose those changes.
Using `git add filename` command,
you tell Git to start tracking changes to file `filename` within your working directory.
you tell Git to start tracking changes to file `filename` within your working tree.
- **staging area (index)** -
once you tell Git to start tracking changes to files
(with `git add filename` command),
Git saves those changes in the staging area on your local machine.
Each subsequent change to the same file needs to be followed by another `git add filename` command
to tell Git to update it in the staging area.
To see what is in your working directory and staging area at any moment
To see what is in your working tree and staging area at any moment
(i.e. what changes is Git tracking),
run the command `git status`.
- **local repository** -
stored within the `.git` directory of your project locally,
stored within the `.git` working tree of your project locally,
this is where Git wraps together all your changes from the staging area
and puts them using the `git commit` command.
Each commit is a new, permanent snapshot (checkpoint, record) of your project in time,
Expand All @@ -106,14 +106,16 @@ with different parts of the Git infrastructure, including:
is to always do a `git pull` before a `git push`, to ensure you have any latest changes before you push your own.

<!--
Created with https://mermaid.live/edit#pako:eNqVkjFrwzAQhf-KuKmlKd01BAoZ2yUZumi5SmdbRPI58oliQv57JbuloSaFajqd3sd7x-kMlh2BhpFOmXpLO49twmh6Vc4bp6PvW7Xziaxwmh6324eDYFubz4lQq9aLQucW_fVTlb6wxaD2NPDoK77ILcfoZSF-Kyq1p8hCK2zIY7dAK8Ftr4bEdretVgPqOWBH9shZ_stFSi39EXFNfQ0WgrobO05ic4nM6Sd6uYXAH-TU-6Susz3NZvewgVJE9K7s8Fy9DUhHkQzoUjpqMAcxYPpLkWIWPky9BS0p0wby4FC-Vw66wTCWLrma-HX5F_P3uHwCS-vA3Q
Created with https://mermaid.live/edit#pako:eNqVUsFOwzAM_ZXIJxBldK3aZjlMQsANLhsSEuolNF5brU1KmgjKtH8nbRlsTEPCJ9t5L-9Z9gYyJRAYtPhqUWZ4W_Jc8zqVxMWT0utS5uRRI17O5xdLw_O-vtbIGclLQ7gQI3T_qYfeq4xXZIGNakujdDfCM1XXpRkZvxE9a4G1MnhEa2xbjKQjwGmtFZqsOC21PxsbvBWYrZU1_6DUqHP8w9gB4WuSqiJnbaG0yazzqPSPV1dVlXpDQV46su_oatA5Bw9cUvNSuH1tetkUTIE1psBcKnDFbWVSSOXWQbk1atnJDJjRFj2wjeBmt15gK161rouiN_sw3sBwCh5oZfPiG9Fw-axUffjN3UDb9XLdWxpzjVKgvlFWGmDxdOAD28A7sIhGkygJ_Wjm08APp4EHHbAknszCJAoCSumUhvHWg49Bz5_QJPJdRGEYz5IkpttPWWLlPg

sequenceDiagram
Working Directory->>+Staging Area: git add
Staging Area->>+Local Repository Branch: git commit
Local Repository Branch->>+Remote Repository Branch: git push
Remote Repository Branch->>+Local Repository Branch: git fetch
Local Repository Branch->>+Working Directory:git merge
Remote Repository Branch->>+Working Directory: git pull (shortcut for git fetch followed by git merge for a 'tracking branch')
Working Tree->>+Staging Area: git add
Staging Area->>+Local Repository: git commit
Local Repository->>+Remote Repository: git push
Remote Repository->>+Local Repository: git fetch
Local Repository->>+Working Tree:git checkout
Local Repository->>+Working Tree:git merge
Remote Repository->>+Working Tree: git pull (shortcut for git fetch followed by git checkout/merge)
-->

<!--
Expand Down
Loading