DevOps Classroomnotes 07/Jul/2023

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 execute git 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 of one.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
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

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

Please turn AdBlock off
Customized Social Media Icons from Acurax Digital Marketing Agency
Exit mobile version
%%footer%%