2013年10月15日 星期二

[Git] Build up git server

##################################
Server Part :
mkdir <Project Name>
cd <Project Name>
sudo git --bare init
chmod 777 ../<Project Name> -R

##################################
Client Part (First time):
cd /path/to/your/projects/new_project
git init

#####  Add repository into git remote  #####
git remote add origin ssh://Remote_login_account@Remote_login_host/var/git/new_project.git/

If want change ssh, Please type
git remote set-url origin ssh://root@111.2.1.103/home/freeman/CVS/UBEE_D3_CableRG.git

##################################
git add .
git commit -m '註解'
git config pack.threads 1
git tag -a <tag name> -m <description> (-a <tag name> -m <description about the tag>)
git push origin master --tags

##### cvs checkout  #####
git clone ssh://Remote_login_account@Remote_login_host/var/git/new_project.git/

##### cvs add file && cvs commit #####
cd directory
git add *
git commit -m "Adding new files"
git push ssh://Remote_login_account@Remote_login_host/var/git/new_project.git/

##### cvs checkout by using tag #####
git clone -b "tag name" ssh://root@111.10.10.10/home/happy/git

##### Update Tag to remote repository #####
git tag -a <tag name> -m <description>
git push origin --tags

Reference:

 

Related Posts:

0 意見:

張貼留言