Brian Var
Brian Var

Reputation: 6227

How to commit a project to a new repository hosted on GitHub?

I recently deleted my GitHub account and created a new one, but when I try to commit projects to the new account, I'm getting errors referring to projects from the old account like:

remote: Repository not found.
fatal: repository 'https://github.com/BrianVarley/College-Final-Year.git/' not found

But the repo I'm commiting to is not that name. The command sequence I'm using is as follows:

cd F:\Projects\AndroidBrian
git init
git add .
git commit -m "first commit"

After the previous statement I get this error also:

nothing added to commit but untracked files present

git remote add origin https://github.com/BrianJVarley/2nd_Year_Android.git
git push -u origin master

The new account is also BrianJVarley and the repo name is 2nd_Year_Android.

Is there a way to fix this? Why do you think its still using my old account and projects?

Upvotes: 0

Views: 1007

Answers (2)

Monil Jain
Monil Jain

Reputation: 1

Before committing to any repository, use git config to configure your GitHub account credentials and add your SSH key to your account. Otherwise, you can't push your files to any repository.

Upvotes: 0

zerkms
zerkms

Reputation: 255005

Yep, change the path to the correct one in a .git/config file

Why do you think its still using my old account and projects?

Because you haven't changed it manually and git cannot read your minds

Upvotes: 2

Related Questions