Git is a distributed version control system that helps you track changes in your code and collaborate with others. Think of a shared Microsoft Word file you might use to collaborate on a document.
This Is How Git Works
Here's a simple overview of how Git works in basic steps:
Initialize a Git Repository: Start using Git by initializing a repository in your project folder.
Add Files: Tell Git which files you want to track.
Commit Changes: Create a snapshot of the changes by committing them to the repository.
Check Status: See the status of your repository to know which files are modified or staged.
Create Branches: Work on different branches to isolate changes.
Switch Branches: Move between branches.
Merge Changes: Combine changes from one branch into another.
Pull and Push: Fetch and merge changes from a remote repository. Push your changes to the remote repository.
Clone a Repository: Start working on an existing Git repository by cloning it.
View History: Examine the commit history to see who made changes and what changes were made.
Here is an example
Question
I consider my self as Mid Level I think 🤔
12 Most Used Git Commands
git init - Initialize a new Git repository.
git clone - Clone a remote repository to your local machine.
git status - Check the current state of your working directory.
git add - Stage changes for the next commit.
git commit - Record staged changes and create a snapshot.
git push - Upload local changes to a remote repository.
git pull - Fetch and merge changes from a remote repository.
git branch - List, create, or delete branches.
git checkout / git switch - Switch between branches or commits.
git merge - Integrate changes from one branch into another.
git diff - View differences between working directory and staging area.
git log - Display a chronological list of commits.
There are other important concepts about git which we will cover later.
Happy Gitting. Is this even a word? lol
Shockingly the single most important git command isn’t even mentioned: git rebase.