ML WORK SHOP

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

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

Commit the file:
git c…


This content originally appeared on DEV Community and was authored by Harish .R

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

Add a file to staging area:
git add 24mcr032.txt
Adds 24MCR001.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 24mcr0.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/HARISH200212/24mcr032.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 "hari733733@gmail.com"
git config --global user.name "HARISH200212"
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 “message”
git push origin main


This content originally appeared on DEV Community and was authored by Harish .R


Print Share Comment Cite Upload Translate Updates
APA

Harish .R | Sciencx (2025-04-23T18:39:36+00:00) ML WORK SHOP. Retrieved from https://www.scien.cx/2025/04/23/ml-work-shop/

MLA
" » ML WORK SHOP." Harish .R | Sciencx - Wednesday April 23, 2025, https://www.scien.cx/2025/04/23/ml-work-shop/
HARVARD
Harish .R | Sciencx Wednesday April 23, 2025 » ML WORK SHOP., viewed ,<https://www.scien.cx/2025/04/23/ml-work-shop/>
VANCOUVER
Harish .R | Sciencx - » ML WORK SHOP. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/04/23/ml-work-shop/
CHICAGO
" » ML WORK SHOP." Harish .R | Sciencx - Accessed . https://www.scien.cx/2025/04/23/ml-work-shop/
IEEE
" » ML WORK SHOP." Harish .R | Sciencx [Online]. Available: https://www.scien.cx/2025/04/23/ml-work-shop/. [Accessed: ]
rf:citation
» ML WORK SHOP | Harish .R | Sciencx | https://www.scien.cx/2025/04/23/ml-work-shop/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.