Git Contd
- Create a local repository
- create an empty directory and execute
git init
- Configure username and email id
one time job
- Create one file
one.txt
and executegit status
- Three areas quick revision
- Lets add this change to the staging area
- Lets create a commit with this one change
- For every commit git gives commit id with username, email, message and date time information
- Create a new file
two.txt
and change the contents ofone.txt
- untracked files represent the files newly created in working tree which donot have any history in local repo and for the files which are already existing in local repo we see states such as
- modified
- renamed
- deleted
- Lets add both the changes to staging area
- Current worktree. By default git always shows the content of the latest commit in working tree
- Lets move back to history i.e first commit
- Lets go back to latest commit
git checkout master
- Lets move two.txt and one.txt to a new folder called as docs and commit the changes
Commands
- init: this initializes a new repository
- add: adds the changes from working tree to staging area
- status: shows the status of working tree and changes
- commit: this command commits the changes from staging area to local repository
- log: shows the commits done in local repo