You can get a Git project using two main approaches.
1. The first takes an existing project or directory and imports it into Git.
2. The second clones an existing Git repository from another server.
git init
Or,
Create a new project Directory like: ~/practice/my_projects/Java

Go to '~/practice/my_projects/Java' path and create Two file like above picture and file content looks like following. This tutorial only for git beginner's practice.
HelloWorld.java
--------------------------
README.txt
---------------------
Then execute following Command .
git init
This creates a new subdirectory named
Its tells there is something to commit 'Java/'. Thus continuing the commit process you have to add those untracked file/folder for staging like follows and check status for conform status.
Then commit the staging data into your local/system repository.
2.Cloning an Existing Repository
If you want to get a copy of an existing Git repository — for example, a project you’d like to contribute to — the command you need is
This is an important distinction — Git receives a copy of nearly all data that the server has. Every version of every file for the history of the project is pulled down when you run
In fact, if your server disk gets corrupted, you can use any of the clones on any client to set the server back to the state it was in when it was cloned
You clone a repository with
1. The first takes an existing project or directory and imports it into Git.
2. The second clones an existing Git repository from another server.
1. Initializing a Repository in an Existing Directory
If you’re starting to track an existing project in Git, you need to go to the project’s directory and type :git init
Or,
Create a new project Directory like: ~/practice/my_projects/Java

Go to '~/practice/my_projects/Java' path and create Two file like above picture and file content looks like following. This tutorial only for git beginner's practice.
HelloWorld.java
--------------------------
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
}
}
README.txt
---------------------
README Well come to Git tutorial.
Then execute following Command .
git init
This creates a new subdirectory named
.git that contains
all of your necessary repository files — a Git repository skeleton. At
this point, nothing in your project is tracked yet. Execute 'git status' to see the status of repository. It will display following message.Its tells there is something to commit 'Java/'. Thus continuing the commit process you have to add those untracked file/folder for staging like follows and check status for conform status.
Then commit the staging data into your local/system repository.
2.Cloning an Existing Repository
If you want to get a copy of an existing Git repository — for example, a project you’d like to contribute to — the command you need is
git clone. This is an important distinction — Git receives a copy of nearly all data that the server has. Every version of every file for the history of the project is pulled down when you run
git clone.In fact, if your server disk gets corrupted, you can use any of the clones on any client to set the server back to the state it was in when it was cloned
You clone a repository with
git clone [url]. For example, if you want to clone the Ruby Git library called Grit, you can do so like this:$ git clone git://github.com/schacon/grit.git



No comments:
Post a Comment