How to upload a folder to github

ls  /tmp
project1  project2  project3  project4  

I want to upload project1 and its folders and files to github.

if you do so

cd / tmp/project1
git init
git add.
git commit-m "upload"
git remote add origin https://github.com/xxxx/mygit.
git push-u origin master-f

all the files in project1 are uploaded, but they are not wrapped by project1.

if
cd / tmp
git init
git add.
git commit-m "upload"
git remote add origin

Mar.18,2021

two methods:

< hr >

1. Remember git add * * you can choose which one to add to the resource to upload, so you can just add the project1 directory

.

2. For a simple and rude method, create a .gitignore file under the / tmp directory, write down the folders that cannot be uploaded, and then use it normally

.

the easiest way to pull a branch from github to local, and put the file to be uploaded to github into this branch file anywhere and execute the git command


directly git add project1/ is fine

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35e74-2bfd4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35e74-2bfd4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?