DEV Community

Cover image for Git - First Commit
Prathamesh Patil
Prathamesh Patil

Posted on • Edited on

4 1

Git - First Commit

Prerequisites :- Git is installed on your machine.

Step 1: - Create a repository on GitHub
Step 2: - Create a Folder on your local
Step 3: - Now open a terminal for this directory and hit cmd

git init
Enter fullscreen mode Exit fullscreen mode

Step 4: -Setup your configuration

git config --global user.name "Your Name"
git config --global user.email  Your Email
Enter fullscreen mode Exit fullscreen mode

to see all the config you can type

git config --list
Enter fullscreen mode Exit fullscreen mode

Step 5: Now to connect repository to local folder

git remote add origin "Your repository URL"
Enter fullscreen mode Exit fullscreen mode

you can copy your repository url from github

Step 6: Now you are all connected you can start your work in folder you created to push your code follow below cmds

  • Will show all changes
git status
Enter fullscreen mode Exit fullscreen mode

I will create my new branch and will push our code there

git checkout -b "your branch name"
git add .
git commit -m "First Commit"
git push origin "your branch name"
Enter fullscreen mode Exit fullscreen mode

Done your code is on Git :) :)

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay