Git is a free, open source DevOps tool that is used to track changes in a set of files. These excellent Git resources will teach you common Git terminology, best practices and guidelines, tutorials for beginners, and articles about specific Git commands. Finally, you will find courses, training, and other resources to help you learn GitHub.
Learn Git
Git Init: A Step-by-Step Guide
The Git init command creates a new Git repository. The init command sets up all the configuration files you need to work with git in a folder called .git/. You only need to run the git init command once. When…
Git Merge
Merging lets developers bring their changes onto an individual line of development. To merge two branches, you can use the git merge command. Once you run this command, the changes from one branch are merged into the branch you are…
Git Clone
The git clone command creates a copy of a remote repository on your local machine. By default, the clone command saves your code in a folder that shares the name of your repository. This can be overwritten by specifying a…
Git Fetch: A Step-By-Step Guide
The git fetch command downloads all branches, tags, and data from a project to the local machine. Existing local code is not overwritten. Fetch is commonly used with the git reset command to bring a local repository up to date…
Git Error: untracked files would be overwritten by checkout
While using git to keep track of your changes in your project, many things can happen that cause an error. When you move from one branch to another, you might get this error: error: the following untracked working tree files…
Git Error: Pull is not possible…
When we use git, sometimes we come upon confusing errors. This article aims to take a look at one common error when using version control and provide a possible solution. Look at this error: Pull is not possible because you…
Git refusing to merge unrelated histories
There are several places in the git workflow that can cause errors. In this article, we’ll talk about one such error that is confusing to tackle and find a solution to! The Git Error The fatal: refusing to merge unrelated…
Error: Failed To Push Some Refs To Remote
When working with git, you may encounter various errors, especially when working on the same codebase with a team. The Error Message The error: failed to push some refs to remote git error occurs when new changes are pushed to…
What is a Git HEAD?
You’ll encounter the term “HEAD” as you use Git, no matter what commands you run. You’ll find this term widely used throughout the Git documentation. What does it mean? In this guide, we’re going to answer that question. We’ll discuss,…
Download a Single File from GitHub: A Guide
When you clone or pull a Git repository, the entire contents of that repository are downloaded by default. Git does not allow you to download part of a repository. Using GitHub, you can download one file from a Git repository.…
Git: Force Pull
Git prevents you from pulling files to your local machine if any unsaved or untracked changes would be overwritten by the merge operation. You can use the force pull method to force Git to pull the changes you want to…
Git: Restore Deleted File
Git keeps a log of all the changes made to files within a repository. You can restore a file that you have deleted since a previous commit by using the git checkout command. This command lets you navigate to a…
Git Detached HEAD Explanation
A detached HEAD occurs when you check out a commit that is not a branch. The term detached HEAD tells you that you are not viewing the HEAD of any repository. The HEAD is the most recent version of a…
Markdown Cheat Sheet
If you ever used Git, you probably created Readme files, if so you noticed these Readmes are in Markdown. Markdown is a very lightweight markup language, very similar to plain text, that’s very easy to learn and you can get…
Create Folder in GitHub: A Guide
There is no Git feature that supports the creation of an empty folder. To create a folder in Git, you must commit a folder to a repository that contains at least one file, even if that file is hidden. In…
Git Another git process seems to be running in this repository Solution
Only one Git process can run at any given time on a project. If you have multiple processes that are using Git on your computer, you’ll encounter the “Another git process seems to be running in this repository” error. This…
Git Permission denied (publickey). fatal: Could not read from remote repository Solution
You can authenticate yourself with a Git repository using either a Secure Shell (SSH) key or a password. If you use an SSH key and fail to configure that key correctly, you’ll encounter the “Permission denied (publickey). fatal: Could not…
Undo Git Pull: A Guide
The git pull command lets you retrieve changes made to a project from a remote repository and download those changes to your local machine. This operation can be undone using the git reset command. The reset command reverts a repository…
Git: Pull All Branches
Git lets you maintain multiple separate lines of development for a project. These lines of development are called branches. You can retrieve the latest version of a branch from a remote repository independently or you can retrieve the latest version…
Git Your local changes to the following files would be overwritten by merge Solution
You cannot pull code from a remote repository if there are any conflicts between uncommitted changes you have made on your local machine and the contents of the remote repository. This protects you from overwriting code you want to keep.…
Git src refspec master does not match any Solution
You need to add a file to a commit before you can push your changes to a remote Git repository. If you create a new repository and forget to add a file to a commit, you may encounter the “src…
Git Cannot open .git/FETCH_HEAD: Permission denied Solution
Git needs write permissions on the files in a directory called .git/ inside your project folder. If the Git command line does not have access to this folder, you’ll encounter an error like “Cannot open .git/FETCH_HEAD: Permission denied” when you…
Git Your local changes to the following files would be overwritten by checkout Solution
You cannot modify a file on two branches and switch between those branches without committing or stashing the file. This is because Git is unsure what changes should be saved and what changes should be overwritten. This guide discusses the…
Git nothing to commit, working directory clean Explanation
When you have added all of the changes in a repository to a commit, the Git command line will classify your working directory as “clean”. You’ll see this description if you run git status to check the status of your…
Git fatal: Could not read from remote repository Solution
Before you can read from a private repository or write to a Git repository, you must be authenticated. If you use the wrong Uniform Resource Locator (URL) to connect to a repository, or have incorrectly set up your Secure Shell…
Undo Git Init: A Guide
There is no specific undo command for the git init command. You can undo the effects of this command by removing the .git/ folder in a project. This guide discusses why you may want to undo the git init command…
Git remote: invalid username or password Solution
To access private remote repositories and modify remote repositories using the Git command line, you must be authenticated. If you try to access or modify a repository and enter the wrong authentication credentials, you’ll encounter the remote: invalid username or…
Git changes not staged for commit Explanation
Before you create a commit, you have to add the files you have changed to that commit. When you run the git status command before adding files to a commit, you’ll see the changes not staged for commit message in…
Git Please make sure you have the correct access rights Solution
You must have permission to access a Git repository before you can clone or modify a repository. If you try to clone or modify a repository which you do not have permission to access, you’ll encounter the “Please make sure…
Git Fixes: The Current Branch Has No Upstream Branch
It might happen that you are working on your regular day-to-day coding. You create a new branch, make some commits and then after doing git push you get this error: fatal: The current branch <branchname> has no upstream branch. To…