Wednesday, July 5, 2023

Git and GitHub

 VCS: version control system. 

Git is a concept and GitHub is a website that provides that git concept. 

git init
git add .
git commit -m"first commit"
git branch -M main
git remote add origin https://github.com/ranitsarker/portfolio1.git
git push -u origin main

when we will update the code we will use 3 lines

1. git add .

2. git commit -m "here one meaning full name"

3. git push 


If you want to contribute to another project

1st make it a fork 

2nd "git clone"

3rd always have to make a new branch so "git branch" will check on which branch you exit now.

"git checkout main" will help to back you from anywhere to the main branch.

"git checkout -b add-games" means a new branch created. here b mane new branch and "add-games" means brand name.

now for the update code:

1. git add .

2. git commit -m "here one meaning full name"

3. git push that will not work that time. That time 

"git push --set-upstream origin add-games"




0 comments:

Post a Comment