What is Git?
Git is a distributed version control system used to track changes in files, typically source code. It allows multiple developers to collaborate on a project by managing and recording changes over time. Git is widely used because of its speed, efficiency, and flexibility, making it an essential tool in modern software development.
What is GitHub?
GitHub is an online platform for storing, sharing, and collaborating on code using Git. With GitHub, you can store your code online, collaborate with other developers, and track changes over time, all in one place.
Basic Git Command
Here are some basic Git commands:
git init: Start a new Git repository in your current directory.
git clone <repository-url>: Download an existing repository to your local machine.
git add <file>: Stage changes to be included in the next commit.
git commit -m "message": Save staged changes with a commit message.
git status: Show the current status of your working directory and staging area.
git log: View the history of commits.
git push: Upload local commits to a remote repository (like GitHub).
git pull: Download and merge changes from a remote repository.
git branch: List all branches or create a new branch.
git checkout <branch>: Switch to a different branch.
git remote add origin [repository link]: Connect the local folder to the GitHub repository.
git push -u origin main: Push code to the 'main' branch on GitHub.
Before the end of the blog will be able to set up git on window's, creating a respository , making commits, pushing and pulling.
Setting up Git on Windows.
Install Git: Download from https://git-scm.com/book/en/v2/Getting-Started-Installing-Git website, run it, and follow the installation instructions.
Configuring Git:After installation,Open Gitbash as ADMINISTRATOR,and run the following Git command :
- git version TO KNOW THE GIT VERSION.
- git status TO KNOW GIT STATUS IF THERE IS ANY PENDING CHANGE.
- git config --global user.name githubusername LIKE LOGIN USERNAME.
- git config --global user.mail githubemail LIKE LOGIN EMAIL ADDRESS.
- cd filename TO ENTER INTO A PARTICULAR FILE NAME.
- git init TO MAKE A FOLDER A GIT REPOSITORY SO AS TO HAVE ACCESS TO GIT COMMANDS.
- code . TO TRANSIT INTO VS CODE.
SOCIAL SHARE CARD GENERATOR