在Ubuntu中使用PhpStorm進行版本控制的步驟如下:
sudo apt update
sudo apt install git
git config --global user.name "Your Name"
git config --global user.email "youremail@example.com"
File
> Settings
(或 Preferences
,取決于您的系統設置)。Version Control
> Git
。Path to Git executable
指向正確的Git可執行文件路徑(通常情況下,它應該位于 /usr/bin/git
或 /usr/local/bin/git
)。OK
以保存設置。Git
> Initialize Repository
。這將在項目文件夾中創建一個名為 .git
的隱藏文件夾,用于存儲版本控制信息。Git
> Add
。這將把所有文件添加到暫存區,準備進行提交。Git
> Commit Directory
。在彈出的窗口中,輸入提交消息,然后點擊 Commit
按鈕。VCS
> Enable Version Control Integration
。Git
,然后點擊 OK
。Git
> Remotes
。Add
按鈕,輸入遠程倉庫的名稱(通常為 origin
)和URL。OK
以添加遠程倉庫。Git
> Push
。現在,您已經在Ubuntu上使用PHPStorm設置了版本控制。您可以使用PHPStorm的界面來執行常見的版本控制操作,如提交、拉取、推送和分支管理。