1

I want to add a project which is located in my documents into a git repository, is this do-able? Thanks, I've never used git before

Albin Sunnanbo
  • 46,430
  • 8
  • 69
  • 108
newbie
  • 41
  • 1
  • 2
  • 1
    How far have you got? What have you read? Are you stuck, or are you just asking if it's even possible, or worth trying? (The short answer is yes.) – Benjol Sep 08 '10 at 08:45
  • I removed the "svn" tag from your posts since this has nothing to do with svn. Please only add relevant tags to your posts. – Albin Sunnanbo Sep 08 '10 at 09:34

3 Answers3

2

In theory yes:

cd yourRep
git init .
git add .
git commit -m "first commit"

You might want to add a .gitignore first in order to not add every file in your directory.
Some of them might not be relevant: see "Started using git recently … just noticed clones of my files with ' ~ ' appended in the end… why is this happening" for instance.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

Certainly. Start by navigating to the root folder of your project. Once you are there execute git init to initialize a git repository in place. This repository is empty. You will have to add the necessary resources before you can commit them.

Start with git add -i. This is an interactive way of adding new resources to the repository. If you wish to add all files then execute git add . instead. It would be a good idea to create a .gitignore file, add the patterns of unnecessary files to it and then do git add .

Once you are done, execute git commit.

Manoj Govindan
  • 72,339
  • 21
  • 134
  • 141
0

free book

online and or buy book

PurplePilot
  • 6,652
  • 7
  • 36
  • 42