Git is a distributed version control system used to track code changes in files and collaborate on software development projects like web application , mobile Application. It allows multiple developers to work on the same codebase and same time , maintain version history, and coordinate updates effectively.
Every developer has a local copy (repository) with the complete history of the project, enabling offline work.
Git makes it easy to create branches for features, bug fixes, or experiments and merge them into the main codebase without conflicts.
Git keeps a complete log/history of all changes, so you can revert to earlier versions or review the history of changes and find easily error solved without lossing any code .
Multiple contributors can work together without overwriting each other's work using remote repositories (e.g., on GitHub or GitLab).
Changes are first added to a staging area before committing, giving control over what gets included in a specific commit.
Initializes a new local Git repository.
git init
Copies your existing repository from a remote location.
git clone https://github.com/user/repo.git
Shows the status of changes (staged, unstaged, untracked).
git status
Adds changes to the staging area.
git add index.html
Records a snapshot of staged changes.
git commit -m "Added new feature"
Lists, creates, or deletes branches.
List: git branch
Create: git branch feature
Delete: git branch -d feature
Merges the specified branch into the current branch.
git merge feature
Creates a new commit that undoes the specified commit.
git revert abc123
Lists remote repositories linked to the project.
git remote -v
Every contributor has a local repository with the complete project history, enabling offline work. There’s no single point of failure, so if the server crashes, any local copy can restore the project.
Git Branches allow developers to working on new module or bug fixes. Git’s powerful merge tools resolve conflicts smoothly without helping devloper , ensuring seamless collaboration.
Git performs fast operations like branching, merging, and committing. Commands like git status
and git log
run locally, making them quicker than centralized version control systems.
Git keeps a complete history of all changes, allowing developers to see ower commit and when. You can also revert to previous versions if needed like any error occure in code .
Developers can use git clone
, push
, and pull
to collaborate effectively. Git prevents overwriting with features like staging and branching.
Git allows developers to commit and check logs without an internet connection, making it perfect for remote teams or limited connectivity environments.
Git uses SHA-1 hashes to ensure data integrity. Each commit is cryptographically secured, making Git a reliable choice for secure codebases.
Git is open-source and free to use for all developer and organizations .
Git integrates seamlessly with tools like Jenkins and GitHub Actions, enabling automated builds and deployments through CI/CD pipelines.
Teams can adopt workflows like GitFlow or trunk-based development, making Git flexible for various project structures.
With multiple copies of the repository, Git ensures redundancy, minimizing the risk of data loss.
Git scales well for both small and large projects, supporting thousands of contributors without performance issues.
Go to GitHub Desktop and download the installer for your operating system. Run the installer and follow the instructions given by application to install the application.
Open GitHub Desktop and sign in to your GitHub account Using mail , and login uisng google . when you have no github account when click link and create account, create one here.
GitHub Desktop comes with Git pre-installed. You can verify Git installation under Options > Advanced.
In GitHub Desktop, click File > New Repository.... Provide a name, local path, and optional description.
Initialize the repository with a README.md
file, and click Create Repository.
After creating the repository, add a commit message (e.g., "Initial commit"). Click Commit to main to save the changes locally.
Click Publish repository to push the repository to GitHub. Choose whether it will be public or private, then click Publish Repository.
Make changes to files in your repository using any code editor. In GitHub Desktop, you’ll see the modified files under Changes. Add a commit message, click Commit to main, and then click Push origin to sync changes with GitHub.