Git: Prepare a repository for your project

 

Follow these steps to manage your project using GIT:
 
1. create an empty folder:
 
$ mkdir menospior.com && cd menospior.com
 
 
 
2. Create an empty repository:
 
$ git init
Initialized empty Git repository in /home/httpd/domains/menospior.com/.git/
 
3. Create a standard .gitignore file:
 
$ nano .gitignore
 
 
————————
cgi-bin/*
upload/
.idea/*
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# Logs and databases #
######################
*.log
*.sql
*.sqlite
# OS generated files #
######################
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db
————————
 
 
4. Add and commit the file
 
$ git add .gitignore
$ git commit -m "Added standard .gitignore file"
[master (root-commit) 8bce6b1] Added standard .gitignore file
 1 file changed, 34 insertions(+)
 create mode 100644 .gitignore
 
 
5. Prepare your local repository for transportation
$ cd ..
$ git clone –bare menospior.com menospior.com.git
Cloning into bare repository 'menospior.com.git'…
done.
$ touch menospior.com.git/git-daemon-export-ok
 
 
6. Copy it to a remote server:
 
$ scp -r menospior.com.git mt:~/domains/git.portnumber53.com/html/menospior.com.git
exclude                                                                          100%  240     0.2KB/s   00:00
ce6b1371dfa41cb537d5272bb76e038e043f78                                           100%  148     0.1KB/s   00:00
4122f04b2c73f00f5ad1098df5f4cbf2707a14                                           100%   55     0.1KB/s   00:00
56e31ebcc35ab6555ef10a60b10fbc19944e90                                           100%  266     0.3KB/s   00:00
HEAD                                                                             100%   23     0.0KB/s   00:00
git-daemon-export-ok                                                             100%    0     0.0KB/s   00:00
update.sample                                                                    100% 3611     3.5KB/s   00:00
post-update.sample                                                               100%  189     0.2KB/s   00:00
applypatch-msg.sample                                                            100%  452     0.4KB/s   00:00
pre-commit.sample                                                                100% 1704     1.7KB/s   00:00
commit-msg.sample                                                                100%  896     0.9KB/s   00:00
pre-applypatch.sample                                                            100%  398     0.4KB/s   00:00
prepare-commit-msg.sample                                                        100% 1239     1.2KB/s   00:00
pre-rebase.sample                                                                100% 4951     4.8KB/s   00:00
packed-refs                                                                      100%   85     0.1KB/s   00:00
config                                                                           100%  125     0.1KB/s   00:00
description                                                                      100%   73     0.1KB/s   00:00
 
7. Finish preparing your repository on the remote server
 
 
$ ssh mt
Linux n22 3.2.6mtv10 #1 SMP Wed Apr 4 09:28:15 PDT 2012 x86_64
 
$ cd ~/domains/git.portnumber53.com/html/menospior.com.git/
$ git –bare update-server-info
$ cd hooks
$ mv post-update.sample post-update
$ chmod a+x post-update
$ exit
logout
Connection to s97042.gridserver.com closed.
 
 
 
 
 
 
8. Now clone your repository locally so you can start working
 
$ git clone mt:~/domains/git.portnumber53.com/html/menospior.com.git menospior.dev
Cloning into 'menospior.dev'…
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3/3), done.
 
 
 
 
 
 
 
 
 
 
 

 

Bookmark the permalink.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • IGlr