Question: I have installed [GitHub Desktop](https://desktop.github.com/) and Git on a Windows machine. I got a GitHub account and created a dummy repository.

When I intend to upload my package through the [Git Bash](https://superuser.com/questions/1053633/what-is-git-bash-for-windows-anyway) command line, it fails with an error:

```
fatal: refusing to merge unrelated histories

```

I used several ways to overcome these issues by using an existing solution from this community, but still it didn't fix the problem. Is there a trick of working this problem? How can I upload my projects to GitHub successfully?

Answer: 
Try the following:

```
cd /path/to/my/repo
git init
git add --all
git commit -m "Initial commit"
git remote add origin <remote repo URL>
git push -u origin master

```

Be sure to replace `/path/to/my/repo` with the path to your repository directory (e.g., `C:\Users\jvrat\Documents\MSPC`), and `<remote repository URL>` with the URL to your remote repository (e.g., `https://github.com/username/repo_name.git`).
The first step is to initialise Git inside your local project directory:

```
git init

```

After that, your directory is a local Git repository and contains a *.git* directory.

You then basically create files and add it to your repository via

```
git add <file-name>

```

Files added to your repository are tracked now. If you want to commit all the changes you made to the files you added, you just need to

```
git commit "Commit message"

```

These all reside in your local Git repository.

To connect your local repository to a remote one you have to issue another command:

```
git remote add origin <remote repo URL>

```

'origin' and the following URL represent the remote name and its URL.
You are now able to push your local changes to your *origin* repository via

```
git push <remote-name> <branch-name>

```

which is in your case

```
git push origin master

```

because for now you just have the *master* branch.

You can check the status of your local repository and its connected remote repository via

```
git status

```