Our first step is to install Chocolatey, if not installed already on your Windows 10 PC.
We can install Git Bash on Windows 10 using the Chocolatey software package manager.
It keeps different versions of your source code so we can easily retrieve a previous version of your code when you make a mistake. Git is a version control system, a system that keeps track of any modifications in the source code. This will ensure that your local Git repository is set up now to track the remote "master" branch.This article details the steps of installing and configuring Git on Microsoft Windows 10. So while subsequent pushes only need the command above, the first one will need this: git push -set-upstream origin master You need to tell Git that you're pushing your local master branch and that the remote is the associated upstream. The first time you push to a repository the command is a little different. Use this command template to achieve this. git commit -m "InsertCommitMessage" - All commits have to be made with a message describing what said commit is.You can either add individual file names or use. git add - Any file to be committed to a Git repo first needs to be staged with this command.This command will tell you whether your local copy is up to date with a remote, whether you have untracked files to add and whether you have changes to be committed. git status - It's a good idea to check the status of your local repository before you begin adding files and committing them.Once this is out of the way, the process and commands are as follows.
Our full GitHub beginners guide will walk you through it.
With GitHub, the easiest way to do this is to download the GitHub CLI tool and use it to log in with your account credentials as it saves having to use access tokens. Essentially you have to add files to be tracked, then you can commit them, then push.īefore you push to a remote service, you will have to ensure you're authenticated on your local machine to do so. There is a process to follow each time, which is outlined below. There's a lot you can do with Git, but besides using it to clone and handle remote version changes, you'll likely want to push some of these files to a remote repository such as on GitHub or GitLab. Now, you can start pushing changes to your Git repository. Git config -global user.email "YourEmailAddress" git config -global user.name "YourUserName" There are two simple commands to enable everything you need. If you're a solo artist you might not see why this matters, but it's crucial as soon as you start collaborating with even one other person. This is because every commit is logged to the person who made it. You don't have to push to a remote service like GitHub, there are local options like Gitea that you can self-host, but wherever you're pushing to there's one essential first step. This will set up everything you need for Git to handle version control for everything within that directory. Open the directory you want to use as a Git repository in your terminal and enter this command: git init To begin with, though, you need to set things up locally. There are two parts to this, where you have a local Git repository, which you then push to a service like GitHub.
How to download (clone) a repository with Git
If at any time you need assistance simply type git -help into the terminal. You can also use Git on both Windows and inside WSL alongside each other and interact with the same local directories as WSL has full access to the Windows file system.
One important thing to remember also is that while you may have to install Git for Windows specifically, Git itself is platform agnostic so the commands are going to be the same whichever you're using. But, if for some reason it isn't, you can install Git yourself in the terminal using the command sudo apt install git. In WSL distros like Ubuntu and Debian, Git should already be installed from the first time you set up. If you want to use the Windows Package Manager for an even easier installation, open up a new PowerShell window and enter winget install git. To install Git on Windows you can simply go to the website, download, and then install the executable. The installation will include a dedicated Git Bash terminal, but you don't have to use that, instead, you can just open up the PowerShell terminal you're more familiar with. To get started on Windows, you'll first need to install Git.