Github Commands
Github:- Github is a online hosting service for git repositories.
Git Commands:-
(1) Git init:- It is used to convert an existing unversioned project to a git repo or intialize a new, empty repository.
(2) Git add . :- The dot means all the files that exists in the repository. If we want to add specific file, we use this commands - git add filename.file extension
(3) Git status:- To know the state of your file
(4) Git commit:- The next state for a file after the staged state is the commited state. We use the following command - git commit -m "first commit"
(5) Git remote:- It is a common repository that all members use to exchange their changes that is hosted on the internet or another network.
We use this command git remote add origin (new repo github website)
(6) Git branch:- This command changes your main branch's name to "main". We use this command - git branch -M main
(7) Git push:- It pushes your rep from your local device to Github. We use this command - git push -u origin main
(8) Git checkout:- It is supposed to switch to a new branch. We use this command - Git checkout -b (branchname)
(-b) will create the branch also no need to create the branch manually.
Good
ReplyDelete