DEV Community

YUGESHWARAN G
YUGESHWARAN G

Posted on • Edited on

Git Commands Execution for Machine Learning

Initialize a Git repository:
git init
Creates a new empty Git repository in the folder 24MCR126.

Add a file to staging area:
git add 24MCR126¬.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 24MCR126.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/Yugeshwaran-gm/24MCR126.git
Links the local repository to a remote GitHub repo.

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

Changing 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 "yugeshwarangm@gmail.com"
git config --global user.name "Yugeshwaran-gm"
Sets your global Git identity.

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

Image description

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 “message”
git push origin main
Enter fullscreen mode Exit fullscreen mode

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Image of Quadratic

Free AI chart generator

Upload data, describe your vision, and get Python-powered, AI-generated charts instantly.

Try Quadratic free

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay