GIT ( Version Control System )
Basic Git Commands
Creating a New Repository
To initiate a new Git repository:
git init
Cloning a Repository
To clone an existing repository from a remote source:
git clone <repository-url>
Checking Repository Status
To check the status of your repository:
git status
This command shows you which files have been modified, added, or deleted.
Staging Changes
Before committing changes, you need to stage them:
git add <filename>
To stage all changes:
git add .
Committing Changes
To commit the staged changes:
git commit -m "Your commit message"
Viewing Commit History
To view the commit history:
git log
This command displays a detailed list of commits, including commit messages, authors, and timestamps.
Pushing Changes
To push changes to a remote repository:
git push origin master
Replace master with the branch you want to push.
Pulling Changes
To pull changes from a remote repository:
git pull origin master
Again, replace master with the branch you want to pull.
This basic Git tutorial provides an introduction to essential Git commands. As you delve deeper into version control, you'll discover more advanced features and workflows offered by Git.