Udemy 課程Microservices with Spring Cloud 28

建置設定檔Server與安裝並連動git repository(用local方式)

ZONGRU Li
4 min readJul 11, 2019

另外建置一個新專案

來到SpringIO

一樣在pom加上

並在application.properties加上

試執行確認專案是否正常:

程式執行正常:

接著google搜尋git

進到git官網下載git

然後執行安裝

git預設編輯器選擇(之後可以透過指令更改)

幾秒後...

可以大概看一下英文介紹

以上基本就裝完了

在來到D槽開個資料夾:

git-local-repo

在此目錄下開cmd

打上指令:

git init(會建立初期的git repository)

在資料夾會看到隱藏檔

回到Eclipse的Java專案spring-cloud-config-server

右鍵連動該專案與剛剛建的git repository

Build Path → Configuration Build Path…

選到方才建的git repo目錄的路徑

就會看到多了對應的資料夾在project內

在這個新目錄右鍵新增file

準備將要給予的設定檔資料放這裡面

所以命名為limits-service.properties (limits-service即專案名)

並把原本limits-service專案內設的設定值抄過來(也調整一下數值)

上面只是在Eclipse的專案目錄的設置,對於git來說這筆新的檔案還沒commit

所以一樣在同個cmd下執行指令:

git add 檔名

或是

git add -A

(上面意指全部登記)

接著下指令:

git commit -m “first commit”

一筆資料commit帶兩行字串

--

--

ZONGRU Li
ZONGRU Li

Written by ZONGRU Li

2022/11/17 開源部分個人筆記給LINE "Java程式語言討論區"社群,希望能對社群的技術學習做一點點貢獻.(掩面....記得退訂閱!

No responses yet