Git allow developers to track changes to their coder. While
GitHub is a web-base platform service for git repositories.
You can use Git without GitHub but you can not use GitHub without Git.
In this article, we are going to explore some of the most common Git and GitHub commands used by developers.
Git Commands:
git init: This command initializes a new Git repository in the current directory.
git add .: This command adds files to the staging area, which prepares them to be committed.
git commit -m"": This command creates a new commit with the changes made to the files in the staging area.
git status: This command shows the current status of the repository, including which files have been modified and which are staged for commit.
git log: This command shows a log of all the commits made to the repository.
git branch: This command shows a list of all the branches in the repository.
git checkout: This command allows you to switch between branches or create a new branch.
git merge: This command merges changes from one branch into another.
git pull: This command fetches and merges changes from a remote repository.
git push: This command pushes changes to a remote repository.
GitHub Commands:
git clone: This command clones a remote repository to your local machine.
git fork: This command creates a copy of a repository in your GitHub account.
git pull-request: This command creates a pull request to merge changes from one branch into another.
git merge: This command merges changes from a pull request into the main branch.
git issues: This command shows a list of all the issues in a repository.
git pull: This command fetches and merges changes from a remote repository.
git push: This command pushes changes to a remote repository.
git branch: This command shows a list of all the branches in the repository.
git checkout: This command allows you to switch between branches.
git stash: This command temporarily saves changes that are not ready to be committed.
In conclusion, Git and GitHub are powerful tools that allow developers to manage code repositories and collaborate on projects. By mastering these commands, developers can work more efficiently and effectively in a team environment.
Top comments (1)
/* Very easy to use both Git and GitHub command */