Git & GitHub basics
In software development industry Git & GitHub are very popular tool among developers to track changes, collaborate with others and manage their project effectively.
What is Git ?
Git is a distributed version control system use for tracking changes in source code during software development.
Git works on developer’s local computer. This means developer can create repositories, commit changes and manage branches without an internet connection. Git allows developers to work on various features separately and merge them later into the main project. Also git allows multiple developers to work on different features at the same time
Features of Git
- track changes in code
- branching & merging
- history tracking
- work offline
- improve team collaboration
Common Git commands
Get Dilani Thathsarani’s stories in your inbox
Join Medium for free to get updates from this writer.
Repository Setup & configuration
- git init — to initialize a new git repo.
- git clone <url> — to copy existing repo. to local computer
- git config — global user.name “[name]” — to set global username for future commits
- git config — global user.email “[email]” — to set global email for future commits
- git config --list — to show all configuration settings
Committing Changes
- git status — to display current status of files
- git add <file>— to add files to staging area
- git add . — to add all modifications & new files to staging area
- git commit -m “message” — to commit changes with descriptive message to the repo.
- git log — to shows commit history of repo.
Branching & Merging
- git branch — to list all local branches
- git branch <branch-name> — to create new branch
- git branch -d <branch-name> — to delete a branch
- git checkout <branch> — to switch to a different branch
- git checkout -b <branch-name> — to create new branch & switch to it
- git merge <branch> — to merge changes from specific branch into current branch
Remore Repository Commands
- git remote — to list remote repos.
- git remote add origin <url> — to connect remote repo. to local repo.
- git fetch — to download updates from a remote repo. without merging
- git pull — fetch changes into remote repo. and merge into current branch
- git push — to upload local commits to remote repo.
- git push -u origin <branch> — to pushes a branch and sets upstream tracking
What is GitHub ?
GitHub is a web-based platform built on top of git version control system, it provides hosting for git repositories. It enables developers to store code remotely and collaborate with others. GitHub provides tools for code review, issue tracking, and project management.
One of the most useful features of GitHub is pull requests, which allow developers to suggest changes and get feedback before merging code into the main branch.
Features of GitHub
- repository hosting
- collaboration
- code review
- integration with continuous development (CI/CD)
Git vs GitHub
In shortly,
Git and GitHub are essential tools in modern software development. Git manages and tracks code changes using powerful commands, while GitHub allows developers to collaborate and share projects globally. Together, they provide an efficient and reliable development workflow.







