When you clone a repository from another source and want to set it up and push it to your new personal repository, follow these steps:
- Clone the existing repository:
1git clone <existing_repository_url>2cd <repository_name>- Remove the old remote URL:
1git remote remove origin- Add your new remote URL:
1git remote add origin <your_new_repository_url>- Verify the remote URL is set correctly:
1git remote -v- Initialize the local repository (if not already initialized):
1git init- Add all changes and commit:
1git add .2git commit -m "Initial commit"- Push to the new remote repository:
1git push -u origin mainIf your default branch is not main but master or another name, replace main with the appropriate branch name.