From: john clarkson To: [email protected] Sent: Sunday, December 21, 2014 3:05 PM Subject: [git-users] how to add a file?
I'm a complete beginner with Git. I looked at the language reference for 'add': http://www.git-scm.com/docs/git-add I looked at one of the videos: "Git basics: Get going with Git" I looked at the tutorial: http://git-scm.com/docs/gittutorial I assume I can add a file from a client computer to my Git repository. I assume the following command should work: 'add Desktop/sampleFile.html' when a file is located on my client at that path. Instead, I get the response 'pathspec did not match any files'. What am I missing? Hi John, I think you are still using a 'file based' source control mind set. In Git you should use a Directory/Folder/Project mindset where the 'entity' is the folder, so only things within the folder can be source controlled. Git places its .git sub-folder (containing the local history repo) at the top level of your folder of interest. Git knows its your folder of interest because it contains that .git folder! Start by creating a MyProject folder, initializing your git repo while inside that folder, and copy the relevant files into that folder at their proper places (i.e the right relative hierarchy), and your 'git add <file>'; 'git commit -m<msg>' should start working for you. Git isn't hard. It the unlearning of the old 'bad habits' and misunderstandings that's the issue ;-) Philip -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
