Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Copy/Pasting a directory onto my repository!

Oscar Martinez Carmona March 30, 2014

Hi!

I'm a newbie to git and SourceTree. I've created a repository and following the steps created a textfile and allready committed and pushed it into the repository. Fine. Now I'm trying to copy/paste a folder containning other folders with the classes i'm trying to write, but... still haven't managed how to do it so! I try direct copy/paste into the working tree but it doesn't seem to work!

Can you guys walk me thought this, please!

Thanx so much in advance!

1 answer

1 accepted

0 votes
Answer accepted
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 31, 2014

Do those folders have any contents yet (besides other folders)? Git only tracks files, not folders. As far as Git is concerned an empty folder may as well not exist.

Oscar Martinez Carmona March 31, 2014

Well, actually those folders contain other code files. I want to upload (sorry for that profane expression here) a folder called, in this case, "libraries" with a few folders inside it that contain code files, the classes headers and its implementations (.cpp and .h). But there's none empty folders here. Is that feasible with a copy/paste?

Thanx!

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 31, 2014

Yeah, that all sounds fine. If you paste files (or folders that contain files) into your working copy, they should show up in SourceTree as untracked files (untracked have a ? icon). From there, they can be added and committed to the repository, then pushed to remotes.

One possible issue - are you pasting folders inside your repository or beside it? In other words, the folder that you are pasting into should have a (possibly hidden) .git folder.

Oscar Martinez Carmona March 31, 2014

Maybe that could be one of the reasons if this screenshot I'm posting makes any sense to you, cause that's the only answer I get whenever I try pasting a folder or a single file!

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 31, 2014

I've never seen that patch window before, but I don't think it is related to what you are trying to do.

Try using the commands on this page to make sure hidden files/folders are showing, then post a screenshot of finder in the root of your repository.

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 31, 2014

You might also try View > Refresh in SourceTree.

Oscar Martinez Carmona March 31, 2014

I don't know if it's related but it appears when I try dropping stuff on the working tree.

I'm posting the screenshot, in fact you were right; there's a git hidden folder!What should I do with it?

Thanx a lot for your wisdom and patience Seth!

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 1, 2014

A git hidden folder is good, that means you're in the right place.

Based on your latest comment, it sounds like you are dropping the folder you want to add onto SourceTree itself. I've never done that, but it appears to be trying to do something different than what you want. Try just dropping the folder into your working copy in Finder.

Oscar Martinez Carmona April 1, 2014

That was the point! (plus I was looking in the wrong folder with the same name but elsewhere... (a lame user like me the biggest bug :-P ).

Thanx a lot Seth! A lot of good karma to you or like we Catalans say (I'll try to translate the expression for you): "God bless you with a few sons but a lot of attempts!"

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events