1. 程式人生 > 其它 >安裝配置git/repo過程記錄

安裝配置git/repo過程記錄

安裝.deb包

sudo dpkg -i teamviewer_15.25.5_amd64.deb

配置java

1. 下載OpenJDK17U-jdk_x64_linux_hotspot_17.0.2_8.tar.gz
2. 解壓縮到/usr/lib/jvm
3. 安裝這個java包:
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-se-7u75-ri/bin/java 111
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-se-7u75-ri/bin/javac 111
4. 配置這個java:
sudo update-alternatives --config java

linux命令:

設定環境變數:export 變數名=變數值
刪除環境變數:unset 變數名
顯示環境變數:env
顯示某個環境變數:echo $REPO_URL

建立符號連結:sudo ln -s /usr/bin/python2.7 /usr/bin/python

repo初始化

git config --global user.email "[email protected]"

git config --global user.name "fengxz"

repo init --repo-url=ssh://[email protected]:29418/tools/repo -u ssh://[email protected]:29418/manifest -b m-tfphone-base-ts-dev-v2

repo sync

cp -r ~/git-repo ~/gph/.repo/repo:將home目錄下的git-repo拷貝到gph/.reop/下並改名為repo

repo sync遇到的問題

一、warning: project ‘repo‘ branch ‘stable‘ is not signed
解決辦法:
  1. Linux sudo apt-get install gpgv2
  2. Delete ~/.repoconfig so it sets up gpg correctly: rm -rf ~/.repoconfig


二、warn: cannot enable ssh control master for [email protected]:29418
[Errno 13] Permission denied
fatal: cannot exec 'ssh': Permission denied
fatal: unable to fork
fatal: cannot exec 'ssh': Permission denied
fatal: unable to fork
^Caborted by user
解決辦法:
  需要設定臨時環境變數,只需要執行第一個就可以了
  PATH=~/bin:$PATH
export REPO_URL="ssh://[email protected]:29418/tools/repo"