Learning the Workflow
<aside> <img src="https://prod-files-secure.s3.us-west-2.amazonaws.com/2ba07339-dd53-47ac-b00d-c83e7722c42d/b39e600d-15ce-44a6-b5ce-eb6490d84e29/Colorful_Illustrative_Young_Male_Avatar_(1).png" alt="https://prod-files-secure.s3.us-west-2.amazonaws.com/2ba07339-dd53-47ac-b00d-c83e7722c42d/b39e600d-15ce-44a6-b5ce-eb6490d84e29/Colorful_Illustrative_Young_Male_Avatar_(1).png" width="40px" /> Learning the Workflow
When we are creating repo on GitHub, then we want to actually clone it from the GitHub.
It will automatically input inside our local computer.
Working Directory - Staging Area - Repository
When we are using**git init
**
We just make repository in our local
It is like a commit to tell Git that we actually have change on second workflow for example.
We can also redo or move backwards to previous commit.
It is working to specific working directory.
For example, we just work on that directory, then the changes and commit will solely affect this directory.
For instance, we got another device and when we do git init
we can safely assume there will be working directory after that**.**
It will only be stored in this working directory.
Not in the GitHub.
“Staging Area”, it is not a name of branch. But when we are working on a file, then we added that to git. The condition is name “Staging Area.”
For instance, we want to add something, by using function.
git add program.py
It will enter into “Staging Area.” → It is not in GitHub yet.
This Repo is still local.
git commit
still local, but the changing has been tracked.
It will still in local not in GitHub. Because, in order to make it into GitHub we are going to do push.
git commit -m "python code"
It will move the program.py
It will move directly from “Staging Area.” to Repo.
However, still it is still in the local.
The message local is “python code.”
When we use function git add .
(Dot or. symbol refers to all files that have changes)
All of these files (index.html
, style.css
) will move to “Staging Area.”
Unless there is not change for instance the file named program.py
For instance, we are going to commit git commit -m "site files"
where the files name “site files” will be moved to Repo.
The result will be all files has been moved to Repository with the message commit “site files.”
In order to make it into GitHub we need to do git push
Our local working directory only contain **program.py
**
While the repository in GitHub, it has already all files such **program.py
** , index.html
, style.css