Preface: Someone asked me how I uploaded my files to my new GitHub warehouse, and I saw some people in the group asking. So I'm going to write an article, record how to upload the local new project to their GitHub warehouse, hoping to help people who still do not understand, the big God, Daniel, Danale please ignore. 1. Create a new local library
Find a path to create a new folder, or you can use Git-bash
Open git bash and use mkdir to create a folder
Command:
mkdir python2 #新建名为python2的文件夹cd python2 #进入文件夹git init
2. Add the project file you want to upload to the new local library
Copy the project files or folders that you need to upload to GitHub to the new Python2 local repository
- And then through git Add. Add all the files in this directory to the warehouse, note that the points are separated by a space
Command:git status #查看状态git add . #把该目录下的所有文件添加到仓库
- Commit the project file to the repository using the git commit command
Command:git commit -m "first commit" #添加-m参数,提交的注释内容
3. Create SSH Key
- Or in GIT bash Terminal input command
git config --global user.name "你的GitHub用户名"git config --global user.email "你的GitHub注册邮箱"ssh-keygen -t rsa -C "你的GitHub注册邮箱"
- When prompted to set the password, press the ENTER key directly. Because that is to set your secret key password, set up, each time you use the secret key to enter the password. I use their own computer usually only their own use, so do not set the secret key password, if you are using a public computer, you can set the secret key password to ensure that the secret key security.
- Add a public key to GitHub
4. Create a warehouse on GitHub
6. Push all the contents of the local library to the remote repository (GitHub new library)
Upload a new local project to GitHub's new warehouse