- #1
fog37
- 1,549
- 107
- TL;DR Summary
- Git, staging and committing files
Hello,
I started learning Git and I am very clear on some of the steps in the Git workflow. For example, we initialize a folder to be a repository with
We place a file called file1.txt inside the folder, make some changes to it and stage it, i.e. we make a copy of the file in the staging area using
We can then complete the process making a commit using
Along the way, we use commands like
,
...
I am not sure what do to from here. Is the command
with certain options the command to use? I guess we want to compare the file in the working directory with saved/committed versions of it....
Why is it important to use
to compare what is in the staging area with what has been committed?
At the end of the day, once we are happy with the all the changes to a file, do we use
to take the commit/save version back into the working directory and use it/email it out?
Thank you
I started learning Git and I am very clear on some of the steps in the Git workflow. For example, we initialize a folder to be a repository with
Code:
git init
We place a file called file1.txt inside the folder, make some changes to it and stage it, i.e. we make a copy of the file in the staging area using
Code:
git add file1.txt
Code:
git commit file1.txt
Code:
git log
Code:
git status
I am not sure what do to from here. Is the command
Code:
git diff
Why is it important to use
Code:
git diff --cashed
At the end of the day, once we are happy with the all the changes to a file, do we use
Code:
git checkpoint hash
Thank you
Last edited: