git init: Initializes a new Git repository in the current directory, creating a hidden .git folder to store repository metadata.
git clone [repository URL]: Clones an existing repository from a remote server to your local machine, creating a copy of the repository along with its entire history.
git add [file(s)]: Adds file(s) to the staging area, preparing them to be included in the next commit. You can specify individual files or use wildcards to add multiple files at once.
git commit -m "[commit message]": Commits the staged changes to the repository with a descriptive commit message. The commit message should succinctly describe the changes made in the commit.
git status: Displays the current status of the repository, including the files that have been modified, staged, or not yet tracked by Git.
git log: Shows a chronological list of commits in the repository, including commit hashes, authors, dates, and commit messages.
git branch: Lists all existing branches in the repository. Adding a branch name creates a new branch, while appending -d followed by a branch name deletes the specified branch.
git checkout [branch/commit]: Switches to the specified branch or commit, updating the working directory to reflect the state of the chosen branch or commit.
git merge [branch]: Merges the specified branch into the current branch, combining the changes from both branches. Conflicts may arise during the merge process, which must be resolved manually.
git pull: Fetches changes from the remote repository and merges them into the local branch. It is equivalent to running git fetch followed by git merge.
git push: Pushes committed changes from the local repository to the remote repository, updating the remote branch with the latest commits.
git remote -v: Lists all remote repositories associated with the local repository, along with their corresponding URLs.
git fetch: Retrieves changes from the remote repository without merging them into the local branch. It updates the remote tracking branches.
git reset [file(s)]: Unstages file(s) from the staging area, preserving the changes in the working directory. You can use git reset --hard to discard all staged and unstaged changes.
git diff: Shows the differences between the working directory and the staging area or between two commits. It helps identify changes made to files before staging them.