A Beginners Guide on the Use of Git through Windows PowerShell
This guide assumes readers know how to use Windows PowerShell to make directories and navigate the system to change working directories and how to use GitHub.
One of the most straightforward ways to use Git is to use it via a terminal and the terminal system on Windows as of the writing of this guide is PowerShell a screenshot of which is included in the guide.
Make sure you have Git downloaded on Windows if you don’t you can download it here.
Also keep in mind these git commands:
git init
- initializes the repository in your working directorygit config —global user.email “someone @example.com”
- This tells the system your email. Replace someone@example.com with the email attached to your GitHub account.git config —global user.name “username”
- This tells the system your username. Replace username with your GitHub username.git remote add origin <repository link>
- This clones the repository to your working directory. Replace <repository link> with the link to a repository shown below.
git add <file path>
- This will stage the file specified in the file path you replace <file path> with.git commit -m “Commit Message”
- This commit everything staged to the local repository. Replaces Commit Message with your own commit message.git branch <branch name>
- This branches the repository to a new branch. The name of the new branch is what you put as <branch name>.git checkout <branch>
- This jump to branch specified.git push origin <branch>
- This pushes the local repository to the remote one on the branch specified.git pull origin <branch>
- This pulls from the branch specified and into the working directory.git stash
- This stashes the changes in the working directory.
You should set up your cloned repository in a directory of your own making as the files from the repository come in as they are and not in a singular file packed together. You initialize in the working directory to start and then give your email and username to the system to let the system know who you are and if you have permission to use the repository. Then you can clone it in. Once it is cloned in you can use the repository as normal without having to clone it again.