DevOps Classroomnotes 07/Jul/2023

Git Contd

  • Create a local repository
  • create an empty directory and execute git init
    Preview
  • Configure username and email id one time job
    Preview
  • Create one file one.txt and execute git status
    Preview
  • Three areas quick revision
    Preview
  • Lets add this change to the staging area
    Preview
  • Lets create a commit with this one change
    Preview
  • For every commit git gives commit id with username, email, message and date time information
    Preview
  • Create a new file two.txt and change the contents of one.txt
    Preview
  • 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
    Preview
    Preview
  • Current worktree. By default git always shows the content of the latest commit in working tree
    Preview
  • Lets move back to history i.e first commit
    Preview
    Preview
  • Lets go back to latest commit git checkout master
    Preview
    Preview
  • Lets move two.txt and one.txt to a new folder called as docs and commit the changes
    Preview
    Preview
    Preview

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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner