git init
To clone an existing repository from a remote source:
git clone <repository-url>
To check the status of your repository:
git status
This command shows you which files have been modified, added, or deleted.
Before committing changes, you need to stage them:
git add <filename>
To stage all changes:
git add .
To commit the staged changes:
git commit -m "Your commit message"
To view the commit history:
git log
This command displays a detailed list of commits, including commit messages, authors, and timestamps.
To push changes to a remote repository:
git push origin master
Replace master with the branch you want to push.
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.