Commands of Git & Github

Β·

3 min read

Introduction

Git and GitHub are two of the most important tools for software developers, designers, and other technical professionals. They allow teams to collaborate on projects, track changes to code, and manage version control. Git is a distributed version control system, while GitHub is a web-based platform that provides hosting and management services for Git repositories. In this article, we'll explore some of the most important commands on Git and GitHub.

Git Commands

  1. git init - Initializes a new Git repository in the current directory.

  2. git clone - Creates a copy of an existing Git repository to your local machine.

  3. git add - Adds files to the staging area in preparation for committing changes to the repository.

  4. git commit - Commits changes to the repository, including a commit message that describes the changes.

  5. git status - Displays the current status of the repository, including any changes that have been made but not yet committed.

  6. git diff - Shows the difference between the current version of a file and the previous version.

  7. git log - Displays a list of all commits that have been made to the repository.

  8. git branch - Lists all branches in the repository or creates a new branch.

  9. git checkout - Switches between branches in the repository.

  10. git merge - Combines changes from one branch into another.

  11. git push - Pushes changes to a remote repository.

  12. git pull - Pulls changes from a remote repository to your local machine.

  13. git remote - Shows a list of remote repositories that are currently being tracked.

  14. git fetch - Fetches changes from a remote repository to your local machine, but does not merge them.

GitHub Commands

  1. git clone - Clones a remote repository to your local machine.

  2. git push - Pushes changes to a remote repository on GitHub.

  3. git pull - Pulls changes from a remote repository on GitHub to your local machine.

  4. git fork - Creates a copy of a repository in your own GitHub account, which allows you to make changes to the code without affecting the original repository.

  5. git branch - Lists all branches in the repository or creates a new branch.

  6. git pull request - Sends a request to the owner of a repository to merge changes that you have made into the main codebase.

  7. git merge - Merges changes from one branch into another, typically after a pull request has been approved.

  8. git issues - Allows you to create and manage issues related to a repository, such as bugs, feature requests, or other tasks.

  9. git wiki - Provides a platform for collaboratively creating and editing documentation for a repository.

  10. git releases - Allows you to create and manage releases of a repository, such as major software updates or patches.

Conclusion

Git and GitHub provide a powerful set of tools for managing code and collaborating on projects. By learning these commands and how to use them effectively, you can become a more productive and efficient developer, designer, or other technical professional. Whether you are working on your own or as part of a team, Git and GitHub can help you to stay organized, track changes to your code, and ensure that everyone is working on the same page.

Β