I have git
repository from the project I have deleted the .git
file. Now I have created a new git repository and tried to push the code into the new repo. To do that I have used the command
- git init
- git add .
- git commit -m ""
- git remote add origin https://github.com/xxxx/project-sp.git
- git push -u origin master
For the 5th point, the got an error as
Permission to xxx/project-sp.git denied to xxxx. fatal: unable to access 'https://github.com/xxx/project-sp.git/': The requested URL returned error: 403
Then I have removed the git credentials from the Credential Manager and used the command git pull
I got the message as
warning: no common commits
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From https://github.com/xxx/project-sp
* [new branch] master -> origin/master
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> master
What should I do to push the code to the new git repo. I'm very new to the git. How do I solve this issue?
Update: When I'm trying to use command git push --set-upstream origin master
I'm getting an error as
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/xxx/project-sp.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.