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
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.
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
.