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

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.) Commented Sep 8, 2010 at 8: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. Commented Sep 8, 2010 at 9:34

3 Answers 3

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.

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

Comments

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.

Comments

0

free book

online and or buy book

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.