8.Git Commands
8.Git Commands
What is Git?
• Git is a distributed version control system that
helps track changes in source code during
software development.
Basic Features of Git
• Version Control: Track changes in files over time.
• Branching and Merging: Develop new features
in isolated branches.
• Distributed System: Each developer has a
complete repository copy.
• Staging Area: Intermediate area for changes
before committing.
• Commit History: Record of all changes with
unique IDs.
• Collaboration: Enables multiple developers to
work on a project.
• Backup: Every developer has a backup of the
repository.
Setting up Git
• Command: git config --global user.name "Your
Name"
• Command: git config --global user.email
“ab@gmail.com"
Initializing a Git Repository
• Command: git init
• Initialize a new Git repository.
Cloning a Repository
• Command: git clone [URL]
• Create a copy of an existing repository.
Adding Files to the Staging Area
• Command: git add [file]
• Add file changes to the staging area.
• Viewing Stashes
• Command: git stash list