GITHUB COMMENTS

Step-by-Step Git Commands Execution: Initialize a Git repository: git init Creates a new Git repository in the folder 24MCR090. Add a file to staging area: git add 24MCR090.txt Adds 24MCR090.txt to the staging area. Commit the file: git commit -m "ADDED PERSONAL DETAILS" Creates a commit with the message "ADDED PERSONAL DETAILS". Check Git status: git status Shows that 24MCR090.txt has been modified but not staged. View commit log: git log Displays the commit history (one commit at this point). Add remote GitHub repository: git remote add origin https://github.com/Sanjeevi18/24MCR090.git Links the local repository to a remote GitHub repo. Check current branch: git branch Shows the current branch is master. Rename branch from master to main: git branch -M main Renames the current branch to main. Set Git global config for email and username: git config --global user.email "sanjeevigopalvijaya47@gamil.com" git config --global user.name "Sanjeevi18" Sets your global Git identity. Push code to remote repo for the first time: git push -u origin main Pushes the main branch to GitHub and sets upstream tracking. Then , Again We will Modify or add new file means we need to follow the same steps, like git add . git commit -m “ADDED MOBILE MODEL” (or) git commit -am “ADDED MOBILE MODEL” git push origin main

Apr 24, 2025 - 05:03
 0
GITHUB COMMENTS

Step-by-Step Git Commands Execution:
Initialize a Git repository:
git init
Creates a new Git repository in the folder 24MCR090.

Add a file to staging area:
git add 24MCR090.txt
Adds 24MCR090.txt to the staging area.

Commit the file:
git commit -m "ADDED PERSONAL DETAILS"
Creates a commit with the message "ADDED PERSONAL DETAILS".

Check Git status:
git status
Shows that 24MCR090.txt has been modified but not staged.

View commit log:
git log
Displays the commit history (one commit at this point).

Add remote GitHub repository:
git remote add origin https://github.com/Sanjeevi18/24MCR090.git
Links the local repository to a remote GitHub repo.

Check current branch:
git branch
Shows the current branch is master.

Rename branch from master to main:
git branch -M main
Renames the current branch to main.

Set Git global config for email and username:
git config --global user.email "sanjeevigopalvijaya47@gamil.com"
git config --global user.name "Sanjeevi18"
Sets your global Git identity.

Push code to remote repo for the first time:
git push -u origin main
Pushes the main branch to GitHub and sets upstream tracking.

Image description

Image description

Image description

Then , Again We will Modify or add new file means we need to follow the same steps, like
git add .
git commit -m “ADDED MOBILE MODEL”
(or)
git commit -am “ADDED MOBILE MODEL”
git push origin main