1. GitHub Online Upload Folder
Online upload can also upload the complete folder structure, directly dragged to the Upload File page box.
1.1 Click to upload a file
Click Upload
1.2 Direct drag
Simply drag and drop files in folders and folders. If you click Choose your files, you can only upload individual files.
Direct drag
2. Upload a local folder via the Git tool (local project)
2.1 Download Git tools
Select the corresponding version to download
2.2 After the download is complete, note that you can choose to create a desktop shortcut during the installation process
2.3 Binding Users
Open Git-bash.exe (right-click directly on the desktop, or click the Start button to find Git bash)
Enter the following command (user and mailbox for your GitHub registered account and email) in an open git bash
$ git config --global user.name "hankleo"$ git config --global user.email "[email protected]"
2.4 Setting SSH key (what does Sshkey do in git?) )
2.4.1 Generate SSH Key
First check whether the key has been generated cd ~/.ssh
, if the returned LS has 3 files, then the key has been generated.
Key generation
If there is no key, the
$ ssh-keygen -t rsa -C "[email protected]"
Generated, the process of generating a 3-time enter the return. (default path, default no password login)
After the build succeeds, go to the corresponding directory C:\Users.ssh, open id_rsa.pub with Notepad, get SSH key public key.
SSH key Public key
2.4.2 Configuring SSH key for GitHub account
Switch to GitHub, expand the small triangle of your profile picture, click Settings, then open the SSH keys menu, click Add SSH key to add the key, and fill in the title (preferably in accordance with the local repository).
Then paste the key in the Id_rsa.pub file to this, and then add key to generate the key.
2.5 uploading local items to GitHub
2.5.1 Creating a local project
This is a few folders and files that I created myself.
Local projects
2.5.2 Building a local warehouse
- First go to the IMGs folder
cd F:\Github\imgs
- Execution Instructions:
git init
After the initialization is successful you will find a hidden folder in the project. Git
Execution Instructions:git add .
Add all files to the warehouse
Execution Instructions:git commit -m "提交文件"
Inside the double quotes is the commit comment.
2.5.3 Associated GitHub Warehouse
Copy warehouse address to GitHub IMGs Warehouse
Execution Instructions:git remote add origin https://github.com/hank-leo/imgs.git
You can merge the code with the following command: Pull=fetch+merge
git pull --rebase origin master
After executing the above code, you can see that the local code base has more readme.md files
2.5.4 uploading Local Code
Execution Instructions:git push -u origin master
2.5.5 finished.
You can see that our local project has been uploaded to GitHub.
Completed the
Note: Git cannot manage empty folders, and folders must have files to upload.
Turn from 72772660
Uploading local files to GitHub