Intermediate Git & GitHub
This is a continuation of series I which was an introduction to GitHub and version control systems.
This story aims to provide an in-depth introduction to version control systems using git
and GitHub
. We will use the ⌨️ Command Line Interface (CLI) (i.e. Bash
for Windows and Terminal
in MacOS & Linux users to perform essential command line techniques.
Version control via the terminal involves using command-line tools to interact with a version control system like Git. Here are some common commands you’ll use:
- git init: Initialize a new Git repository in the current directory.
- git clone [repository-url]: Clone an existing Git repository from a remote location (like GitHub) to your local machine.
- git add [file(s)]: Add changes in the specified file(s) to the staging area in preparation for committing.
- git commit -m “[commit message]”: Commit the changes in the staging area with a descriptive message.
- git status: View the status of changes in the working directory, staging area, and repository.
- git log: View a history of commits in the repository.
- git pull: Fetch changes from the remote repository and merge them into the current branch.
- git push: Push committed changes from the local repository to the remote repository.
- git branch: List existing branches in the repository.
- git checkout [branch-name]: Switch to the specified branch.
- git merge [branch-name]: Merge changes from the specified branch into the current branch.
- git remote -v: View information about the configured remote repositories.
These are just a few basic commands for working with Git in the terminal. There are many more commands and options available for managing branches, resolving conflicts, and performing various tasks in Git.
GitHub Desktop is available for those who would want to learn more from the UI interface.
For the experts, series III is coming out soon where we explore more on collaborations and reviews.