HOW to PUSH code to git repository:(process)
1. git init
2. git status
3. git add [file name] –if we want to add single file
4. git add . ---- when we want to add all file
5. git commit -m ‘[commit name]’
6. git branch -M main (It is default branch so no need to use this this command.I will automaticly
add you code to mastar branch.You can skip this command)
7. git remote add origin [your repository link]
8. git push -u origin master ----instead master you can use you your required branch
If we changes any file and add to this repository the follow this(process):
1. git add .
2. git status
3. git commit -m ‘[other commit name]’
4. git push
To live you react site follow this(process):
yarn add -D gh-pages
https://github.com/Moin3/URL-Shortener.git
Present barach check:
git branch
git status
Create new branch:
git branch [new branch name]
check all exist branch:
git branch –list
Switch the branch
git checkout [desired exist branch name]
create new baranch and switch to this branch to in one line command
git checkout -b [new branch name]
To push this code on github follow this step:
git init {not necessary in this case}
check the code starus:
git status
add code to local repository:
git add .
git commit and add comment to this repository
git commit -m ‘[message]’
To push the code to the remote repository:
git push (general case)
git push --set-upstream origin [new branch name] (when we push our code to new branch)
moinIslam