GIT working Practicle

0

Working of Git

Step 1: Install Git and Initialize Repository

  1. Install Git on Amazon EC2 instance using the command: sudo yum install git -y
  2. Create a directory (replace 'dir_name' with your preferred name): mkdir dir_name
  3. Navigate to the directory: cd dir_name
  4. Initialize a new Git repository: git init

Step 2: Create a File, Stage and Commit

  1. Create a file (replace 'file_name' with your preferred name): touch file_name
  2. Add the file to the staging area: git add file_name
  3. Commit the file to the local repository (replace 'commit_message' with your preferred message): git commit -m 'commit_message'
  4. Check the status of your file: git status

Step 3: Configure Git Global Variables

  1. Configure Git global variables (replace 'user.name' and 'user.email' with your preferred username and email): git config --global user.name "username" git config --global user.email "email" git config --list"

Step 4: Use Git Show and Git Log Commands

  1. Use the Git show command to see the changes made in the last commit: git show
  2. Use the Git log command to see the commit history: git log

Tags

Post a Comment

0Comments
Post a Comment (0)