I was working on 2 computers, alternating which one I use, and every time moved the whole thing between them. Then I setup git on computer A and synced it with github repository. So far so good.
Now I want to clone this to computer B, but git clone doesn't work because the folder and files already exist.
So this is what I've done on computer B:
git init
git remote add origin <my-github-rep.git>
git fetch
Now I need to bring the latest files from github here.
git reset origin/master
I think this is what resets current HEAD to point to master branch on origin.
Okay, now here is the problem:
I would assume that at this point I need the following:
git checkout -t origin/master
Because this would bring all the latest files from origin and would have the whole thing checked out on computer B. This is what I want, but it doesn't work. Here is the error msg: "fatal: A branch named 'master' already exists."
How do I overcome this and just bring the files? What have I done wrong.
(to clarify: I don't want just to delete the folder and the files and simply clone the repository because there are many more files in there which are not supposed to be on git, so it's hard to do pick and choose; at this point what I want is to overwrite all the relevant files in my local folders from the latest files in the remote repository - this way I'll have the latest code, and the files that are not tracked by git won't be affected)