GIT
Documentation
Git Doc. Word File Download (Full Course)
Download Me
Install Git in your system.
download
1st step:
Atfirst Install Git in Your system. then Signup in Git website with username and password. ------------------------------------------------------ ------------------------------------------------------ username: t.rth.nka.19.. mail id: ti.....cont.....@gmail.com password: Te.ht...@2023 -------------------------------------------- -------------------------------------------- Create a Folder on your desktop name "videoone" or "Others Folder Name". next open this("videoone") folder with VS Code > Terminal > New Terminal or, open cmd and follow the process. ---------------------------------------------- ---------------------------------------------- Atfirst check the git version: ------------------------------------------------------------------- PS C:\Users\TIRTHA\Desktop\videoone> git -v git version ------------------------------------------------------------------- git version 2.41.0.windows.2 ----------------------------------------------------------- PS C:\Users\TIRTHA\Desktop\videoone> git init PS C:\Users\TIRTHA\Desktop\videoone> git status ----------------------------------------------------------- On branch master No commits yet Untracked files: (use "git add
..." to include in what will be committed) index.html product.jpg nothing added to commit but untracked files present (use "git add" to track) ---------------------------------------------------------- PS C:\Users\TIRTHA\Desktop\videoone> git add . PS C:\Users\TIRTHA\Desktop\videoone> git status ---------------------------------------------------------- On branch master No commits yet Changes to be committed: (use "git rm --cached
..." to unstage) new file: index.html new file: product.jpg ---------------------------------------------------------------------------------- PS C:\Users\TIRTHA\Desktop\videoone> git commit -m "New Files Upload" ---------------------------------------------------------------------------------- Note: At First time after sign up the Git as a new member may be seen error like this "Author identity unknown" *** Please tell me who you are. If this error is coming in your VS code terminal then follow these steps, otherwise, you can skip these steps. ---------------------------------------------------------------------------------------------- /*** start here for authority unknown error in your vs code ***/ Run this code: ----------------------------------------------------------------- git config --global user.email tirtha.contactme@gmail.com git config --global user.name tirtha ----------------------------------------------------------------- Note: to check this error if its resolved or not: -------------------- $ git config --list -------------------- Then you show looks like this in your terminal. user.email=tirtha.contactme@gmail.com user.name=tirtha If it is showing, So, you are going to right track, so follow the next steps: ///*** End here for authority unknown error in your vs code ***/// --------------------------------------------------------------------------------- PS C:\Users\TIRTHA\Desktop\videoone> git commit -m "New Files Upload" --------------------------------------------------------------------------------- [master (root-commit) 5338c49] changes html file 2 files changed, 24 insertions(+) create mode 100644 index.html create mode 100644 product.jpg ---------------------------------------------------------- PS C:\Users\TIRTHA\Desktop\videoone>git branch ---------------------------------------------------------- * master ------------------------------------------------------------------------ PS C:\Users\TIRTHA\Desktop\videoone>git branch -M main PS C:\Users\TIRTHA\Desktop\videoone> git remote add origin https://github.com/tir.h..kar19../videoone.git (Note: If you give wrong url unfortunately write this code: PS C:\Users\TIRTHA\Desktop\videoone> git remote rm origin) PS C:\Users\TIRTHA\Desktop\videoone> git push -u origin main ------------------------------------------------------------------------ Enumerating objects: 4, done. Counting objects: 100% (4/4), done. Delta compression using up to 8 threads Compressing objects: 100% (4/4), done. Writing objects: 100% (4/4), 65.50 KiB | 13.10 MiB/s, done. Total 4 (delta 0), reused 0 (delta 0), pack-reused 0 To https://github.com/tir.h..kar19../videoone.git * [new branch] main -> main branch 'main' set up to track 'origin/main'. /**** THE END *********/ Completed, Thank You, Enjoy /****// THE END //*********/ Please check the github site. you see the folder "videoone" in your account. looks like this: tir.h..kar19../videoone
2nd step:
------------- PUSH::::::::: ------------- After any file Changes or Modify or Add files follow these steps:: open the folder in VS Code that you have worked. Terminal > New Terminal ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- ---------------------------------------------------------- PS C:\Users\TIRTHA\Desktop\videoone> git branch ---------------------------------------------------------- * main /************************************************** Note: to replace or add single or two files use this command: ------------------- git add
------------------- Note: to add or replace all files use this command: ---------- git add . ---------- //*************************************************** Example: -------------------------------------------------------------------- PS PS C:\Users\TIRTHA\Desktop\videoone> git add index.html -------------------------------------------------------------------- or, ---------------------------------------------------------- PS C:\Users\TIRTHA\Desktop\videoone> git add . ---------------------------------------------------------- ------------------------------------------------------------------------------- PS C:\Users\TIRTHA\Desktop\videoone> git commit -m "My First Changes" ------------------------------------------------------------------------------- [main 8496c04] commit message 1 file changed, 1 insertion(+), 1 deletion(-) -------------------------------------------------------- PS C:\Users\TIRTHA\Desktop\videoone> git push -------------------------------------------------------- Enumerating objects: 5, done. Counting objects: 100% (5/5), done. Delta compression using up to 8 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 319 bytes | 319.00 KiB/s, done. Total 3 (delta 1), reused 0 (delta 0), pack-reused 0 remote: Resolving deltas: 100% (1/1), completed with 1 local object. To https://github.com/tir.h..kar19../videoone.git 67e3368..8496c04 main -> main ///////////// DONE, ENJOY ///////////////
Download any file from git Steps:
-------------------------------------- DOWNLOAD FROM GIT ANY FILES ::::::::: -------------------------------------- creat a blank folder name "HELLOWORLD" in desktop, then open this folder in VS CODE. Terminal > New Terminal, then follow these steps: ----------------------------------------------------------- PS C:\Users\TIRTHA\Desktop\HELLOWORLD> git clone https://github.com/tir.h..kar19../videoone.git ----------------------------------------------------------- Note: https://github.com/tir.h..kar19../videoone.git [ this links get from your git account ] //////// ENJOY ////////
some screenshots:
Some Shortcuts
Step 1 : clone to a folder by the provided auth token provided by client Ex. git clone (client's git code) step 2 change the directory to cloned folder. And write below command on cmd to configure user mail and name git config --global user.email (client's git mail) git config --global user.name "(client's user name)" step 3 If needed to create a new branch => git checkout -b new_branch_name it will create you a new branch and will take you to that If already have a branch just have to go to the branch then => git checkout branch_name step 4 Now you can edit the codes in the cloned folder step 5 now add your files and commit to stage branch thorugh vs code extension. Step 6 Now, you have to go the master branch and merge with your stage branch for going to master branch=> git checkout master merge command=> git merge stage_branch_name ##stage_branch_name means newly created branch step 7 Now push the changes withe the command => git push origin master ======== Now your changes are pushed to master and live. ##some commands for help git log =>helps to check activity on the current branch git status => helps to check the status git config --list => helps to see the current config & user abouts
Pull and Push
pull ============
git pull git checkout
git pull origin
push ==============
git add
git add . git commit -u "your note" git push