How to upload local projects to github 2022
The operation in 2022 is different from before. If you want to upload your local project to github, please follow the steps below.
1. Into your project, type git init
to create a local git repository.
2. Type git add .
to keep track of new files, add content from the work area to the staging area (or index area), which is used to determine what the snapshot will look like at the next commit.
3. Then git commit -am "make it better"
to commit the changes in the staging area to the local repository.
4. Create a new repository on the github website,such as 2022.
5. Create a new token. The path is as follows:Settings---Developer Settings---Personal access tokens.
6. Go back to the local repository folder. Type git remote add origin https://[email protected]/yourusername/2022.git
to link to the github remote repository.
7. Type git push -u origin master
to upload your local project to github.
That's it, it is worth mentioning that, try to complete the upload in a short period of time. If there is no operation interval for too long, you may need to log in again. In 2022, github does not support password login, which is really troublesome.