In this lecture we will learn few terminologies of GitHub
What is Version Control System (VCS)?
A version control system (VCS) is a tool that helps software developers manage changes to their source code over time. It allows you to track and manage different versions of your code, collaborate with other developers, and revert to earlier versions of your code if necessary.
Examples of VCSs
There are several version control systems (VCS) available, each with its own unique features and advantages. Here are some examples of popular VCS: ● Git ● Subversion (SVN) ● Mercurial ● Perforce ● Microsoft Team Foundation Server (TFS)
What is git:
Git is a distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Installation and Git Configuration
- Go to the Git website
Choose the appropriate download for your operating system
Download the installer
Run the installer
Choose the installation options
Complete the installation
Verify the installation
Git Configuration
After installing Git, you will need to configure it before you can start using it. Here are the steps to configure Git:
Open a command prompt or terminal window
Set your name and email address
Set your default text editor (optional)
Check your configuration.
What is gitignore
gitignore is a feature of the version control system. Git that allows you to specify files and directories that should be ignored by Git when you commit changes to a repository.
Using Git commands
git init: Create a new Git repository in your project directory .
ex: git init
git clone: Copy an existing Git repository to your local machine.
ex: git clone https://github.com/user/repository.git
git add: dd files to the staging area.
ex: git add filename
Difference between git add . and git add \:* git add . command will add all new and modified files in the current directory and its subdirectories to the staging area.
where as git add * command will add all new, modified, and deleted files in the current directory and its subdirectories to the staging area.
git branch: It will tell the name of the branch.
ex: git branch
git branch branch_name : to create a new branch.
ex: git branch gkd
git checkout branch_name: to get inside the branch.
ex: git checkout gkd
git checkout -b branch_name: directly to create and switch to a new branch.
ex: git checkcout -b hunter
git merge branch_name : for merging one branch to another.
ex: git merge gkd (as we are currently in branch hunter)
This is all about git hope you understand it well.