一、在命令行上创建新的存储库
示例:
1 echo "# JavaProjects" >> README.md 2 git init 3 git add README.md 4 git commit -m "远程仓库接口" 5 git branch -M main 6 git remote add JavaProjects https://github.com/ynxiyan/JavaProjects.git 7 git push -u JavaProjects main
二、从命令行推送现有存储库
示例:
1 git remote add JavaProjects https://github.com/ynxiyan/JavaProjects.git 2 git branch -M main 3 git push -u JavaProjects main
三、 远程仓别名的重命名
1 git remote -v // 查看远程仓 2 git remote rename trunk(现有远程仓别名) private(自定义的远程仓别名) // 修改远程仓别名 3 git remote // 将会显示 master(默认远程主仓别名) 和 private (自定义的个人仓别名)
四、 删除远程仓
1 git remote private // 删除远程仓 2 git remote // 只会显示master(默认远程主仓别名)
标签:git,remote,IDEA,别名,push,JavaProjects,main,远程 From: https://www.cnblogs.com/ynxiyan/p/17026425.html