Ads Top

how to learn github?

 Git tutorial: Github need to use for the purpose of team work. Not for the single person, if you want to save your code on the github and you want to share anyone then you can do easy with full security because when you create a repository then he asked to you give permission private or public.


Need to install git from the download :


As your system requires for the git software.


Create New repo: Need to go in the and create an account as follow him instruction. Now you can authorized for the any modification then go to the top right corner on the site find plus icon (+) and choose “New repository” 


Go to the code section and copy https: path and in your local system create any folder as “firstRepo” . Right click then you will find “Git Bash Here” and you will found a cmd screen as below: 




Need to use command “git clone”


Then you will need to login window for the connectivity from the remote (github sites) and your local system . Again you will find another login window for the confirmation.


You will find clone your folder from the live after then you create any other files as you wish like: index.html then close your “Git Bash Here” add some thing else.

Now again go to your local system folder and right click and again open “git bash here” and type for the checking status your folder: git status then you will find new file as “index.html” as below screen.

github useful commands:

git clone pasteYOurpath  // for the cloning from the live


git status  // for the check git status  modification file status change or not


 git add .   // for all file added on the local environment


git add index.html  // for single file added on the local environment 

git commit -m "basic chagnes add"   // -m mean indicating messages


 git push origin main  // main original file


git push origin branchname // where you are working now.


git branch branchname // For creating new branch

git branch // how much branch are available in this repo, active branch will be green.


git checkout branchname // for the switching branch

git push origin branchname // for the pushing data


git rebase main //  need to update code in which branch me ho and take code from the main branch

// after add, commit, push then pull

git rebase --continue // if found any confliction in rebase then need to continue

git rebase --skip // if not found any confliction then skip it

git pull origin barnchname //  all file need to show as base label so need to use

esc:wq // for the blue text screen exit 

git stash // means need to save your code in local environment

git stash apply // for the return your saved changes from your local environment 

git branch -m headers // on the same branch need to rename header(branch Name) to headers

git branch -m header headers // Need rename branch available on the other branch  means header to headers

git branch -d header // delete branch use -d and for forcefully deletion -D but need to outside for which branch you need to delete....

git fetch --all // pulling all created branches

git fetch <branchname> // for the pulling seprated branch only

No comments:

Copyright Reserved to Anything Learn. Powered by Blogger.