Adding folders and files to a project repository in GitHub is straightforward because of its user-friendly commands. Let’s see the steps to add a folder to a GitHub repository.
To add a folder to a repository in GitHub, we would typically follow these steps:
mkdir
command.mkdir nameOfFolder
git add .
git commit
command:git commit -m "Added new folders to repository"
git push
command:git push origin branchName
Here, origin
refers to the default remote repository that a local repository is linked to, and branchName
refers to the name of the branch that you want to push to the remote repository.
Note: Before executing the aforementioned commands, we need to use the
git init
command to initialize the repository if it has not already been done so.
After performing these steps, the new folder should be added to the GitHub repository.
Free Resources