Reputation: 113
I am new to GitHub, able to create a README textfile and commit that (from my local machine to github site) but now my problem is, i have one folder and i need to commit that folder to git hub, can any one of you help m e on this.
Upvotes: 9
Views: 34468
Reputation: 1
Follow this steps to update your folder to GitHub:
Step 1: Navigate to your local repository(folder) that contains your code and initialize it
$ cd folderName (or) $ cd ~/FolderName
$git init
Step 2: Add the folder to be a part of trackable files/folders list in GitRepository
$ git add FolderName/
step 3: Commit the folder(save your changes made) to GitRepository
$ git commit -m "Some Message"
step 4 : connect GitHub to your local machine, Here you add a remote name origin to GitHub Repository. You can get this URL from "Clone or Download" link from your GitHub
$ git remote add origin URL
Step 5: Push the committed files/folders to HitHub repository
$ git push -u origin master
Refresh the GitHub repository and you could save the folder committed to respository. I hope this would be helpful!!
Upvotes: 0
Reputation: 1355
Its very simple. Follow some steps-
Upvotes: 2
Reputation: 744
Try this :
git commit folder_path -m "your comment"
folder_path should full path, something like this ../../../folder_path
Upvotes: 0
Reputation: 4690
git add FOLDERNAME
After that, you can do a normal commit + push as you did it with the README file.
Upvotes: 1