![]() The local repo after " git init" is empty. If your project uses more than one directories, you may create one Git repo for EACH directory, or use symlinks to link up the directories, or. Hence, it is safe to copy, move or rename the project directory. The Git repo is completely contain within the project directory. Take note that EACH Git repo is associated with a project directory (and its sub-directories). git" will be created under your project root directory (as shown in the above " ls -a" listing), which contains ALL Git related data. rw-r-r- 1 xxxxx xxxxx 66 Sep 14 14:33 README.mdĪ hidden sub-directory called ". rw-r-r- 1 xxxxx xxxxx 142 Sep 14 14:32 Hello.java rw-r-r- 1 xxxxx xxxxx 426 Sep 14 14:40 Hello.class Initialized empty Git repository in / path-to/hello-git/.git/ĭrwxr-xr-x 1 xxxxx xxxxx 4096 Sep 14 14:58. $ cd / path-to/hello-git // Initialize Git repo for this project ![]() ![]() To manage a project under Git, run " git init" at the project root directory (i.e., " hello-git") (via "Git Bash" for Windows, or "Terminal" for Ubuntu/Mac): // Change directory to the project directory Now, we have 3 files in the working tree: " Hello.java", " Hello.class" and " README.md". This is the README file for the Hello-world project. It is also highly recommended to provide a " README.md" file (a text file in a so-called "Markdown" syntax such as " GitHub Flavored Markdown") to describe your project: // README.md ("Hello, world from GIT!") Ĭompile the " Hello.java" into " Hello.class" (or " Hello.cpp" or " Hello.c" into " Hello.exe"). Let's start a programming project under the working directory called " hello-git", with one source file " Hello.java" (or " Hello.cpp", or " Hello.c") as follows: // Hello.java Setup the Working Directory for a New Project We shall begin with "Starting your own project" and cover "Cloning" later " Clone a Project from a Remote Repo".
0 Comments
Leave a Reply. |