Sunday, February 7, 2016

101 How To Create Local GitHub Repository Using Windows Command


.
101 How To Create Local GitHub Repository Using Windows Command

0) Pre-Requisite

Install GitHub to your computer. Download here.
Add GitHub program to your windows environment. Read here.
You have to register an account at www.github.com in order to work with GitHub Repository

1) Run Git Command via Windows Console

Press Windows Start Button, type cmd and press Enter key.
1.1) Type cd \ to go to root of your computer.
1.2) Assuming that you have already created a folder github, type cd github to go to that folder.
1.3) Type mkdir newproject to create a new project folder for your local repository (or repo).
1.4) Type cd newproject to go into the folder.
We are going to start typing git command.
1.5) Type git init
You should get a response...
Initialized empty Git repository in C:/github/newproject/.git/
(The screenshot below shows Steps 1 to 5)
1.6) Add a new text file using Windows Explorer.
1.7) Check the changes in Command Windows. Type git status
You should get a response…
On branch master
Initial commit
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        New Text Document.txt
nothing added to commit but untracked files present (use "git add" to track)
(The screenshot below shows Step 7)
Git did not track your file.
You need to give a command for Git to track the file
1.8) Type git add “New Text Document.txt” and then ...
1.9) ...type git status to check the outcome.
(The screenshot below shows Steps 8 to 9)
Git has tracked your file.
1.10) Type git commit -m "add 'New Text Document.txt'" to put a note on what you have committed.
.

No comments:

Post a Comment

Labels