Here are the steps to be followed installing and setting up Git on a Windows machine using a GitHub account:
Download and install the latest version of Git.
Set your username in Git:
- open Git Bash
$ git config --global user.name ‘Mona Lisa’
$ git config --global user.name
> Mona Lisa
Set your commit email address in Git:
- open Git Bash
$ git config --global user.email ‘email@example.com’
$ git config --global user.email
email@example.com
If you haven't already done so, go to your GitHub account and create a new repository. On your local machine navigate into the folder you want to link with the repository.
Initialize Git in this folder with $ git init
and $ git remote add origin https://github.com/git_profile_name/repo_name.git
.
Now you can check the Git status with: $ git status
.
If not already done, add a .gitignore file to your project.
If there's already something to push, you can stage it with: $ git add *
. If successfully staged, the files can be commited: $ git -m commit ‘message’
. After this step it can all be pushed to the remote repo: $ git push -u origin master
.
You can also find a step-by-step instruction in the Git documentation.