Git 101

GIT and GITHUB
Git :
Gitis an version control tool. It is a DevOps tool used for source code management.Github :
Githubis a code hosting platform for collaboration.
Download Git
Download Git from this Link
After Downloading the
Gityou have to config it.git config
configuring user information used in all local repositories.
git config --global user.name[firstname lastname]git init
git initis used to initialize the git in our project it generates a folder with the name.gitwhich stores all the information about the git stage and commits.git remote
git remote -vis used to get remote access to the Github repository.git status
git statusis used to check the status of our project, it helps us to track the stage/unstaged file/folder in the project.git add
git add filenameis used to add a particular file to the stage and then commit it to our Github repositoryOR
git add .is used to add all the unstaged files to the stage so we can commit them all at once.git commit
git commit -m "message"is used to commit all the staged files and folders.git log
git logis used to check all the logs meaning it helps us to track all the commits by showing the history of the commit done in the project, it shows details like commit hash, time, date as well as the message with the commit.git rm -cached
git rm -cachedis used to unstaged all the stage files and folders meaning it helps us with removing all the files and folders from the stageOR
git rm -cached filenameis used to remove a particular file from the stage.git branch
git branch branch nameis used to create a new branch in our Github repository.git checkout
git checkout branch nameis used to change/switch from one branch to another.git push
git push origin branch nameis used to push from origin to a branch.OR
git push -u origin masteris used to push the commit to master branch.git merge
git merge -m "message"is used to merge from one branch to another branch for Example ( main to master ).git reset
git reset -hard origin/masteris used to reset to last push commit.git pull
git pullis used to pul the files and folder from remote repository to local.


