Certainly! Here are some common Git commands:
- git init: Initializes a new Git repository in the current directory.
- git clone [repository URL]: Creates a local copy of a remote repository.
- git add [file]: Adds a file to the staging area, ready to be committed.
- git commit -m “[commit message]”: Records changes to the repository with a descriptive message.
- git status: Shows the current status of the repository, including modified files and untracked files.
- git push: Uploads local commits to a remote repository.
- git pull: Downloads the latest changes from a remote repository and merges them into the current branch.
- git branch: Lists all branches in the repository.
- git branch [branch name]: Creates a new branch.
- git checkout [branch name]: Switches to a different branch.
- git merge [branch name]: Merges changes from a specified branch into the current branch.
- git log: Displays the commit history.
- git remote: Lists all remote repositories associated with the current repository.
- git remote add [remote name] [remote URL]: Adds a new remote repository.
- git remote remove [remote name]: Removes a remote repository.
These are just a few examples of the numerous Git commands available. Git is a powerful version control system, and there are many more commands and options to explore based on your specific needs.
Leave a Review