link here Create a new repository online using GitHub or GitLab.
Go to your local repository and remove the existing origin remote.
Add the new online repository as the correct origin remote.
- Remove the Existing Remote
git remote set-url origin https://github.com/git/git.git
hint: You have divergent branches and need to specify how to reconcile them. hint: You can do so by running one of the following commands sometime before hint: your next pull: hint: hint: git config pull.rebase false # merge hint: git config pull.rebase true # rebase hint: git config pull.ff only # fast-forward only hint: hint: You can replace "git config" with "git config --global" to set a default hint: preference for all repositories. You can also pass --rebase, --no-rebase, hint: or --ff-only on the command line to override the configured default per hint: invocation.
-git remote -v
origin https://github.com/user/repo.git (fetch)
origin https://github.com/user/repo.git (push)
git remote set-url origin https://github.com/user/repo2.git
git remote -v
origin https://github.com/user/repo2.git (fetch)
origin https://github.com/user/repo2.git (push)
-atal: 'orgin' does not appear to be a git repository fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
-git branch -git branch (branch name) -git switch -c brancName -git branch -d branchName -git rm -r one-of-the-directories // This deletes from filesystem git commit . -m "Remove duplicated directory" git push origin (typically 'master', but not always)
git rm -r --cached FolderName git commit -m "Removed folder from repository" git push origin master
- git remote remove
- git remote -v
- git init -rm -rf .git -Git add origin repo