Windows+Git+TortoiseGit+COPSSH 安裝教程及問題收集

來源:互聯網
上載者:User

標籤:robotium   工作   svc   public   cond   network   安裝路徑   點擊   5.0   

準備工作:

1、 git-1.8.1.2-preview20130201.exe

https://code.google.com/p/msysgit/downloads/list

2、 Copssh_4.1.0_Installer.exe

http://download.csdn.net/download/zzjzmdx/4636227

3、 TortoiseGit-1.8.5.0-64bit.msi

https://code.google.com/p/tortoisegit/wiki/Download?tm=2

 

伺服器系統:Windows Server 2003 SP2

用戶端系統:Windows 7 SP1

 

伺服器端安裝及部署

1、安裝Git

 

 

 

 

 

 

 

 

 

 

 

此處選擇預設安裝

此處選擇第三個,不去轉換成unix的代碼風格

 

 

完成安裝

 

2、安裝SSH及配置使用者

 

 

 

 

安裝在根目錄下,避免路徑中有空格,造成不必要的麻煩

 

 

此處是設定SSH的帳號密碼

 

 

安裝好後提示通過“COPSSH Control Panel”添加使用者

完成安裝

 

 

開始配置SSH使用者

 

選中“Users”選項卡,點擊Add按鈕添加使用者

 

 

選擇使用者名稱,此處可以選擇剛剛安裝SSH時設定的“SvcCOPSSH”使用者,也可以自己建立一個使用者來操作,本教程建立了一個GitAdmin的使用者作為管理賬戶。

 

 

 

 

安裝完成後還有兩個操作:

1、將Git安裝目錄D:\Program Files\Git\libexec\git-core檔案夾下的git-upload-pack.exe、git.exe、git-receive-pack.exe和git-upload-archive.exe這4個檔案複製到SSH的安裝路徑D:\ICW\bin下。

2、將Git安裝目錄D:\Program Files\Git\bin\libiconv-2.dll複製到D:\ICW\bin下。

3、串連Git版本庫

 

進入SSH安裝目錄下的bin檔案夾,調用ssh.exe檔案,輸入以下代碼:

“ssh [email protected]你的伺服器名稱或者IP地址”

鍵入yes

輸入密碼

 

看到這個介面,代表串連成功。此時你已經通過SSH協議串連上了Git。

 

4、建庫操作

登入完成後,此時的實際路徑是在D:\ICW\home\GitAdmin

建庫操作步驟如下:

mkdir testgit //建立testgit檔案夾

cd testgit //進入testgit檔案夾

git init //版本庫初始化,會以testgit為庫名建立一個新庫

touch first.txt second.txt //建立first.txt和second.txt文字文件

git add . //將檔案添加至Git

git config –global user.email “[email protected]”//設定郵箱地址

git config –global user.name “Your Name” //設定使用者名稱

git commit –m “init” //將修改提交至Git

 

cd ~/.ssh //進入.ssh檔案夾

ssh-keygen –t rsa –C “[email protected]” //產生公開金鑰,預設名稱為id_rsa

至此,伺服器端的安裝與配置完畢。

 

註:Git預設設定複製版本修改master版本內資訊後不能提交修改,如需開放許可權,要修改.git/config檔案後面添加如下代碼:

       [receive]

denyCurrentBranch = ignore

  

用戶端安裝與配置

1、安裝Git

       安裝步驟與伺服器端相同。

 

2、安裝TortoiseGit

 

 

 

 

 

 

       安裝完畢

       此時在你的電腦滑鼠右鍵就能看到Git已經整合到了系統快捷操作中。

 

3、配置TortoiseGit

       首先設定TortoiseGit>Settings>Network中SSH client的值為”d:\Program Files(x86)\Git\bin\ssh.exe”。

      

       建立測試local檔案夾,右鍵選中Git Clone選項,會彈出對話方塊,輸入正確的URL,選擇Web方式,選好本地的檔案夾,點擊確定。

 

 

       URL正確的話,會彈出輸入密碼介面,輸入正確後,會將庫資訊複製到本地。

 

       看到Success,恭喜你,你已經擷取到了伺服器上的庫資訊。

 以上轉載http://blog.csdn.net/aaron_luchen/article/details/10498181

-------------------------------------------------------------------------------------------------------------------------------------------

問題:TortoiseGit disconnected no supported authentication

今天,我發現一個從遠程伺服器上擷取到的工程,用Git沒問題,而TortoiseGit報錯:
Disconnected: No supported authentication methods available(server sent: publickey)

 

因為TortoiseGit和git的衝突。 改正如下:

1、TortoiseGit -> Settings -> Network

2、將SSH client設定成 Git\bin\usr\ssh.exe

然後,TortoiseGit 就可以正常工作了!

 

-------------------------------------------------------------------------------------------------------------------

在圖形介面中,執行拉取操作時,出現下面的錯誤。

You asked to pull from the remote ‘origin‘, but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line.

 

解決辦法:

Edit your .git/config

[branch "master"]  remote = origin  merge = refs/heads/master

 

Now you can simply git push and git pull.

 

 

-------------------------------------------------------------------------------

 

查看當前項目有哪些遠程倉庫
$ git remote 
[email protected] wirelessqa$ git remoteorigin
查看遠程倉庫
$ git remote -v 
[email protected] wirelessqa$ git remote -vorigin     [email protected]***.com:xiaopeng.bxp/wirelessqa.git (fetch)origin     [email protected]***.com:xiaopeng.bxp/wirelessqa.git (push)
查看遠程倉庫資訊
$ git remote -v <remote-name>
[email protected] wirelessqa$ git remote show origin* remote origin  Fetch URL: [email protected]****.com:xiaopeng.bxp/wirelessqa.git  Push  URL: [email protected]***.com:xiaopeng.bxp/wirelessqa.git  HEAD branch: master  Remote branch:    master tracked  Local branch configured for ‘git pull‘:    master merges with remote master  Local ref configured for ‘git push‘:    master pushes to master (local out of date) 
添加遠程倉庫:
$ git remote add [remote-name] [url]
[email protected] robotium$ git remote add test git://github.com/paulboone/ticgit.git[email protected] robotium$ git remote -vorigin     https://github.com/RobotiumTech/robotium (fetch)origin     https://github.com/RobotiumTech/robotium (push)test     git://github.com/paulboone/ticgit.git (fetch)test     git://github.com/paulboone/ticgit.git (push)
刪除遠程倉庫:
$ git remote rm [remote-name]
[email protected] robotium$ git remote rm test[email protected] robotium$ git remote -vorigin     https://github.com/RobotiumTech/robotium (fetch)origin     https://github.com/RobotiumTech/robotium (push)
修改遠程倉庫:
$ git remote set-url --push [remote-name] [newUrl]
重新命名遠程倉庫
$ git remote rename <old-remote-name> <new-remote-name>
從遠程倉庫抓取資料 :
$git fetch [remote-name]

說明:

  1. 此命令會到遠程倉庫中拉取所有你本地倉庫中還沒有的資料。運行完成後,你就可以在本地訪問該遠程倉庫中的所有分支
  2. fetch 命令只是將遠端的資料拉到本地倉庫,並不自動合并到當前工作分支,只有當你確實準備好了,才能手工合并
拉取遠程倉庫:
$ git pull [remote-name] [本地分支名]

說明: 一般我們擷取代碼更新都是用Git pull, 目的是從原始複製的遠端倉庫中抓取資料後,合并到工作目錄中的當前分支

推送遠程倉庫:
$ git push [remote-name] [本地分支名]

說明: 只有在所複製的伺服器上有寫入權限,或者同一時刻沒有其他人在推資料,這條命令才會如期完成任務。 如果在你推資料前,已經有其他人推送了若干更新,那你的推送操作就會被駁回。你必須先把他們的更新抓取到本地git pull,合并到自己的項目中,然後才可以再次推送。

$git push origin test:master         // 提交本地test分支作為遠端master分支$git push origin test:test              // 提交本地test分支作為遠端test分支

Windows+Git+TortoiseGit+COPSSH 安裝教程及問題收集

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.