在 Ubuntu 下使用 PhpStorm 操作 Git,一般流程如下(从零开始也能看懂):
sudo apt update
sudo apt install git
验证:
git --version
git config --global user.name "你的名字"
git config --global user.email "你的邮箱"
File → Settings → Version Control → Git
/usr/bin/git
File → New → Project from Version Controlhttps://github.com/用户名/仓库.git
或git@github.com:用户名/仓库.git
VCS → Enable Version Control Integration
此时项目根目录会生成 .git
VCS → Commit
或快捷键:Ctrl + K
VCS → Git → Push
或快捷键:Ctrl + Shift + K
VCS → Git → Pull
或快捷键:Ctrl + T
which git/usr/bin/git生成 SSH Key:
ssh-keygen -t ed25519
cat ~/.ssh/id_ed25519.pub
复制到 GitHub / GitLab
修改代码 → Commit → Pull → Push
如果你愿意,可以告诉我:
我可以直接给你一步步截图级操作说明。