git修改針對全域性或當前專案的git使用者名稱密碼

2021-10-10 17:48:40 字數 891 閱讀 1454

切換到需要修改的專案目錄

專案目錄中.git開頭的目錄,可進入到.git目錄:

執行命令

git config user.name '使用者名稱'
cat config
可以看到name已經修改

執行新增配置

執行:

git config credential.helper store

檢視config檔案:

cat config
看到最後一行新增了helper

git remote set-url origin https://[使用者名稱]:[密碼]@[git位址]

//不設定使用者名稱和密碼的情況

git remote set-url origin https://[git位址]

修改git提交使用者名稱

//修改全域性

git config --global user.name 你要設定的使用者名稱;

git config --global user.email 你要設定的郵箱;

//修改當前專案

git config user.name 你要設定的使用者名稱;

git config user.email 你要設定的郵箱;

刪除遠端端的分支

git push origin --delete [branch_name]
修改日誌名稱:找到專案執行3,6,8即可

修改使用者名稱密碼執行一條命令列即可

Java獲取當前專案的路徑

專案中可能需要讀取專案路徑下的模板等,我們可能需要知道模板的絕對路徑。可以通過如下兩種方法獲取 public void testgetpath throws ioexception比如我的專案templates下有兩個模板,如下圖 twapi with birthday gender.ftl的絕對路...

js獲取當前專案的根目錄

常用的路徑獲取方式如下 window.location.pathname 設定或獲取物件指定的 檔名 或路徑。window.location.href 設定或獲取整個 url 為字串。window.location.port 設定或獲取與 url 關聯的埠號碼。window.location.pro...

當前專案的品牌列表的查詢

service public inte ce brandserviceserviceimp service public class brandserviceimpl implements brandservice brandcontroller restcontroller public clas...