Git

2014-12-30 15:28:37
wangyidong
8449
Last edited by Renee on 2018-06-20 11:26:10
Summary :This article is about how to use ZenTao Cloud Git hosting.

ZenTao Cloud has GIT hosting service. Read the instruction below to use it.


1. Click "Console”->"Manage Git".

Fill in your GIT admin user name and password, and click "Start(Open)".


Then GIT will be available within one minute. The default setting is this admin had privileges to read and write all repositories on this site.


2. Create netrc

     In repository, Git use netrc to confirm username and password. Windows use _netrc 文件, while Linux use  .netrc. The followings are the way to create netrc.

  

     Windows:

     1) Add variable HOME in Windows and set the value %USERPROFILE% as follows,

 

  2) Go to “Start"->"Run” and open %Home%. Create “_netrc”.

 

  3) Open _netrc in Notebook and enter Git server name, user name, password , and Save. For example,

machine xxx.zentaopm.net login xxx
password xxx
    xxx is the Git address, user name , password

   

     Linux:

    Create .netrc on root directory and edit it as

machine xxx.zentaopm.net
login xxx
password xxx
    xxx is the Git address, user name, password.

 

3. Create a branch

 In Linux, run the followings,

#initialize repository 
mkdir test  
cd test
git init

#create readme and add to local
touch readme
git add readme
git commit

#add git origin and push to master
git remote add origin https://xxx.zentaopm.net/zentao.git/
git push origin master

If error: failed to push some refs to 'https://xxx.zentaopm.net/git/qq.git', check whether netrc is created in the right way.

 

4. Testing

Clone Git repository:

git clone https://xxx.zentaopm.net/git/xxx.git other

Check whether it is cloned.

 

Synchronization steps:

git fetch origin

git merge origin/master

    Comment List
    常昕 2016-11-11 13:42:57
    我们内部自建了私有gitlab,云禅道能和我们自建的gitlab集成么?
    王春生 2016-11-15 09:04:09
    云禅道只能和云禅道的git集成。
    变通的方案是做同步。在云禅道开通一个git库,然后定期将gitlab里面的库同步到云禅道的git库。
    张海阳 2016-10-19 18:18:51
    是多少
    王春生 2016-10-26 09:00:00
    请问你是要问什么问题?
    1/1
    Write a Comment
    Comment will be posted once reviewed.