idea本地项目关联远程仓库


idea git操作


idea版本

IntelliJ IDEA 2020.3.2 (Ultimate Edition)
Build #IU-203.7148.57, built on January 26, 2021
Licensed to IntelliJ IDEA Evaluator
Expiration date: March 3, 2021
Runtime version: 11.0.9.1+11-b1145.77 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.1
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 12
Non-Bundled Plugins: Key Prπ

本地项目关联远程仓库

  • 使用idea打开项目,点击VCS -> Create Git Repository...选择当前文件夹

  • 打开Terminal执行下面的命令
# 给项目设置远程远程仓库 #  
git remote add origin 远程仓库地址  
# 抓取远程仓库数据,并自动合并远程分支 #  
git pull origin master   
# 更新本地数据  
git push origin master

推送本地项目到新远程仓库

cd existing_folder
git init
git remote add origin git@8.131.55.209:fc_project/fc.git
git add .
git commit -m "Initial commit"
git push -u origin master

  目录