Git & GitHub
>>>>>compare files :
Windows: FC (file compare)
Mac,Linux: diff
In Git terminology, these user-created checkpoints are called commits.
Commits are the basic building blocks of Git, each one representing a version of the content a one point in time.
Git requires the user to supply commit message each time a commit is created.
>>>>>Using Git to View History
1# git clone <url of the repository> : to download the entire history of a repository
2# git log : to see the commit history
3# git diff -u <commit_ID1 commit_ID2> :compare to see the changes , red for deletions, green for insertions
4# git checkout <commit ID> : temporarily reset all files in a repository to their state at the time of a specific commit
>>>>>Local Git Repository:
1# open terminal -> type command: ls -a to see the hidden files
Notice that , when you initialize the repository, Git doesn't make any commit for you. You have to create first commit yourself.
>>>>>Staging area
1# git add <filename> : adding a file to the staging area
2# git reset <filename>: remove the file from staging area
3# git status : show the current working directory and staging area status
>>>>>>Write a commit message describing your changes
1# git commit -m "commit message"
commit message style guide: http://udacity.github.io/git-styleguide/
>>>>>> Compare the changes between working directory, staging area, repository
Windows: FC (file compare)
Mac,Linux: diff
![]() |
![]() |
In Git terminology, these user-created checkpoints are called commits.
Commits are the basic building blocks of Git, each one representing a version of the content a one point in time.
Git requires the user to supply commit message each time a commit is created.
>>>>>Using Git to View History
1# git clone <url of the repository> : to download the entire history of a repository
![]() |
2# git log : to see the commit history
3# git diff -u <commit_ID1 commit_ID2> :compare to see the changes , red for deletions, green for insertions
4# git checkout <commit ID> : temporarily reset all files in a repository to their state at the time of a specific commit
>>>>>Local Git Repository:
1# open terminal -> type command: ls -a to see the hidden files
Notice that , when you initialize the repository, Git doesn't make any commit for you. You have to create first commit yourself.
![]() |
![]() |
>>>>>Staging area
1# git add <filename> : adding a file to the staging area
2# git reset <filename>: remove the file from staging area
3# git status : show the current working directory and staging area status
![]() |
![]() |
![]() |
>>>>>>Write a commit message describing your changes
1# git commit -m "commit message"
commit message style guide: http://udacity.github.io/git-styleguide/
![]() |
>>>>>> Compare the changes between working directory, staging area, repository
![]() |
![]() |