Creating Local Git Repositories

I accidently delete all my project stuffs by rm -rf.

Yeah I should be more careful. But it happens, this is life. Well the bad thing is that that folder also serves as my git repository. So I lost all my hard work. To avoid that I deceide to set up another local folder to serve as a remote git repository. The next time I will have a working copy there. Hope....

Let us start

1. make a directory:

mkdir ~/gitrepositories/pathogenbase.git

2. enter the new create diretory and initialize the repository

cd ~/gitrepositories/pathogenbase.git

git init --bare

3. now we have a working "remote" repository. We are ready to make a local clone:

cd ~

git clone ~/gitrepositories/pathogenbase.git pathogenbase

4. now we have an empty clone, at my home directory

5. creat a file touch file1

6. git add .

7. git commit -m "create file1"

9. git push origin master

No comments:

Post a Comment

Datatable static image not found on the server

When you use ```datatables.min.css``` and ```datatables.min.js``` locally, instead of datatables CDN, you may have encountered that ```sort...