Skip to main content

Command Palette

Search for a command to run...

Git Commands

Published
1 min read
M

I am a novice web developer


checking whether the git is installed or not

\>git --version


commands for sending data in git after creating a new repository

\>git init

\>git add .

\>git commit -m "first commit"

\>git branch -M main

\>git remote add origin https://github.com/Minhazcox/my-first-repo.git

\>git push -u origin main


Commands after the 1st time push:

\>git add .

\>git commit -m "image added"

\>git push


Commands for group work/teamwork

\>git branch (it will show the current branch)

\>git branch image-add (branch create)

\>git checkout image-add (switched to image-add branch from main)

Send to git

\>git add .

\>git commit -m "added Ariana"

\>git push (it will show an error)

upstream branch add

\>git push --set-upstream origin image-add

merge branch

\>git branch

\>git checkout main

\>git merge image-add

send data

\>git push


Data pull from the main branch

\>git pull

Create a new branch & get me there

\>git checkout -b add-blog

After working in the add-blog branch we need to send data to git

\>git add .

\>git commit -m "blog added"

\>git push (it will show an fatal error because upstream branch add-blog is not added)

add-blog to upstream

\>git push --set-upstream origin add-blog

merging add-blog branch to main branch

\>git checkout main

\>git merge add-blog

send data to the main branch

\>git push

The resource link for git branch commands

https://github.com/joshnh/Git-Commands

More from this blog

একজন ভালো ডেভেলপার হওয়ার ১০ স্কিল

১. প্রোগ্রামিং নলেজ: মিনিমাম একটা প্রোগ্রামিং ল্যাংগুয়েজ তোমাকে দক্ষ হতেই হবে। এবং দরকার হলে সেই একটা প্রোগ্রামিং ল্যাংগুয়েজ এর আশেপাশে কিছু জিনিস থাকলে সেগুলাও জানতে হবে। যেমন, ওয়েব ডেভেলপার হতে হলে তোমাকে জাভাস্ক্রিপ্ট জানতে হবে। সেটার আশেপাশে HTML...

Sep 22, 20237 min read

Journey to a Web Developer

7 posts