How do I upload a folder to a GitHub repository?
Category:
technology and computing
web hosting
On GitHub, navigate to the main page of the repository. Under your repository name, click Upload files. Drag and drop the file or folder you'd like to upload to your repository onto the file tree. At the bottom of the page, type a short, meaningful commit message that describes the change you made to the file.
Keeping this in consideration, how do I add a new folder to my git repository?
Go to your project folder :
- $ cd /path/to/my/project. Add your project files to the repository :
- $ git init. $ git add . $ git commit -m "Initial import"
- $ git push -u origin master. After this initial import, pushing your changes will just require this command :
- Push your branch to Github: git push origin master.
- Go back to the folder/repository screen on Github that you just left, and refresh it.
Then, how do I upload a folder to GitLab?
To get started, first install and set up Git on your Linux, Mac, or Windows PC. Then, open the Terminal (Git Bash on Windows) and navigate to the local folder that you want to sync with your GitLab project. Use the cd command to switch to the folder in question.
A new repo from an existing project
- Go into the directory containing the project.
- Type git init .
- Type git add to add all of the relevant files.
- You'll probably want to create a . gitignore file right away, to indicate all of the files you don't want to track. Use git add . gitignore , too.
- Type git commit .