CentOS 7 is an old Linux. The version of git on it is 1.8
However, vscode git extension expects git >2.0.
step 1. upgrade git 1.8 to git 2.x. because VSCode likes git >2.0
follwing the instruction of https://www.endpointdev.com/blog/2021/12/installing-git-2-on-centos-7/
# remove old git 1.8
sudo yum remove git
sudo yum remove git-*
# install latest git 2.x
sudo yum install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
sudo yum install git
step 2. create ssh key. It makes gitee recognize me.
following the instaruction of
【教程】在VSCode中使用码云进行代码管理.md · watfe/Public - Gitee.com
ssh-keygen -t rsa -C "youremail@xxx.com"
cat ~/.ssh/id_rsa.pub
Open the SSH public key manager page: https://gitee.com/profile/sshkeys
Fill the title: yourname's SSH key
public key: the content of ~/.ssh/id_rsa.pub
push the button of "add"
Then you can test your connection to gitee using next command in a terminal.
ssh -T git@gitee.com
if everything goes well, you wil get the info
# Welcome to Gitee.com, YourGiteeName
step 3. save your user name and user.email to your git config.
git config --global user.name yourname
git config --global user.email youremail@xxx.com
step 4. let git remeber you so that not ask your password frequently.
git config --global credential.helper store
step 5. clone your project from gitee to local in a terminal
git clone https://gitee.com/YourGiteeName/project.git your_local_path
You may get the project.git url from the project webpage on gitee.com
You may asked to provide the password. Only one time is neccessary for you
to provide the password. After that, git will connect gitee without asking you
for the password anymore.
step 6. install vscode and
step 7. use vscode "open folder" to open your_local_project_path.
Then you can edit your source code. The git extension in vscode can track the modification.
You can commit, push, pull your project files with git extension in vscode.