Connect GitHub Repository
If you have disconnected from GitHub and need to reconnect, you'll need to follow the reconnection process. You can check whether the connection has been disconnected through the link.
(This article does not involve the method via a mirror.)
If you've disconnected a previously linked GitHub repository, you'll need to create a new repository.
- Access GitHub.
- Click "New" to create a new repository.
- For the Owner, if it's a team project, select the team name; for an individual project, select your personal identity.
- Enter the repository name to ensure it's not duplicated.
- Provide a brief description.
- Choose between Public and Private based on the situation. (Public is recommended for portfolio use.)
- For "Add a README file," it's recommended to create one, but you can proceed without checking as you can create it later without issues.
- It's advised to check "Add .gitignore." (Even for personal repositories, if they contain crucial information like API keys, it's recommended to list them in .gitignore to restrict pushes.)
- If prompted to "Choose a license," you can organize and upload it separately. (You can proceed without selecting, but for Public repositories, it's recommended to review the content and then choose.)
In summary, "GitHub create a new repository on the command line" entails creating a new GitHub repository and connecting local and remote repositories. On the other hand, "Push an existing repository from the command line" involves connecting an existing local Git repository to a GitHub repository and uploading changes.
As the task involves disconnecting an existing connection, creating a repository, and then establishing a connection, we will copy the "Push an existing repository from the command line" command.
git remote add origin firstname.lastname@example.org:cptkuk91/explain.git
git branch -M main
git push -u origin main
Proceed Step by Step
It's fine to paste the lines one by one, but you can also paste and execute them all at once.
Verify the Connection
If you entered
git remote -vin a GitHub-disconnected repository and didn't see any response, after inputting the above command, you'll see
origin email@example.com:cptkuk91/explain.gitas output.
git add .
Once connected, let's upload all the data to the GitHub repository.
After GitHub Repository Connection
git add . git commit -m "[Add] Migrate existing repository" git push origin explain
Before uploading all the data, make sure to check
If you get stuck at
git add ., it's likely because there are no changes. You can write a comment or something to proceed.