Git & GitHub
Git is an open-source distributed version control system that allows developers to track changes to source code over time, collaborate with others, and maintain multiple branches of a codebase. With Git, developers can work on code offline, make changes, commit those changes to a local repository, and then sync those changes with a central repository when they are ready.
GitHub, on the other hand, is a cloud-based hosting service for Git repositories. It provides a platform for developers to store their Git repositories in the cloud, as well as a range of collaboration and project management features such as issue tracking, pull requests, and code reviews.
Some key differences between Git and GitHub include:
Git is a version control system, while GitHub is a cloud-based hosting service for Git repositories.
Git can be used locally on a developer's machine, while GitHub requires an internet connection to access and use.
Git can be used for free without any restrictions, while GitHub offers both free and paid plans with additional features and storage options.
Git is primarily a command-line tool, while GitHub provides a web-based user interface that makes it easier to manage Git repositories and collaborate with others.
In summary, Git is a version control system, while GitHub is a cloud-based hosting service for Git repositories with additional collaboration and project management features. Git can be used independently of GitHub, but using GitHub can make it easier to collaborate on code with others and manage projects.
Git Command list
Here is a list of some commonly used Git commands:
git init: Initializes a new Git repository in the current directory.
git clone [repository-url]: Copies a remote Git repository to your local machine.
git status: Displays the status of the current repository, including which files have been modified.
git add [file-name]: Adds a file or changes to the staging area.
git commit -m "[commit message]": Commits the changes in the staging area to the repository with a commit message.
git push: Pushes committed changes to a remote repository.
git pull: Fetches changes from a remote repository and merges them into the local repository.
git branch: Lists all branches in the repository.
git checkout [branch-name]: Switches to the specified branch.
git merge [branch-name]: Merges the specified branch into the current branch.
git log: Displays a log of all commits in the current branch.
git reset: Resets the current branch to a previous commit.
git stash: Temporarily stores changes that are not yet ready to be committed.
git tag: Lists all tags in the repository.
git remote: Lists all remote repositories linked to the local repository.
These are just a few of the most commonly used Git commands, and there are many more available depending on your specific needs.
Next >> Create a Git Environment