11

I need to set up a github for a school project but Im getting lost in the complicated workings of it.

I managed to push the contents of a folder to my repository but since I need to add other files and want to keep some structure I want to take the current files & folder I have and move them into a new directory.

For example, I want to change the following:

Master Folder X Folder Y File Z 

To

Master Project 1 Folder X Folder Y File Z 

How do I do this exactly? I've found similar posts with similar explanations but I never understood any of them.. Could some please explain this in an easy fashion? Because I've been trying without success for nearly two hours now.

5
  • 1
    mkdir Project_1; git mv Folder_X Folder_Y File_Z Project_1/ Commented Jun 1, 2014 at 10:32
  • Do I enter this code in gitbash? Commented Jun 1, 2014 at 10:33
  • @OliCharlesworth This does not appear to be working for folders. Do you know how I can delete folders out of my repository so I can upload them in a correct way? Commented Jun 1, 2014 at 10:40
  • I hope you're not planning on adding Project2 to the same repository! Commented Jun 1, 2014 at 10:51
  • I was planning on adding a second folder under my master yes, would that be a problem? Commented Jun 1, 2014 at 10:55

2 Answers 2

10

Move files as you want in your local folder

and after that simply commit all changes in git bash:

git add "Project 1" git commit -am "change folders layout" 

and push changes:

git push 
Sign up to request clarification or add additional context in comments.

5 Comments

You'll want to git mv, not just mv.
Git handles it either way
@exussum: Actually, that's true (I hadn't noticed this answer includes git add before the git commit).
@webSpider I might have done something wrong and I ended up deleting all my files. I am now going to push them again but directly into the correct folder. Do I just do this by using this command? git remote add origin github.com/username/repository/folder.git ?
you'll need git commit and git push after that.
6

just change github.com with github.dev in the link you see on your repository, you will go to the editor and you can do it in a simple way

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.