git 日常代码使用

Command line instructions

Git global setup
git config --global user.name "user"
git config --global user.email " @y.com"

Create a new repository
git clone https://code.internal.com/meng/asdasd.git
cd asdasd
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

Existing folder
cd existing_folder
git init
git remote add origin https://code.internal.com/meng/asdasd.git
git add .
git commit -m "Initial commit"
git push -u origin master

Existing Git repository
cd existing_repo
git remote rename origin old-origin
git remote add origin https://code.internal.com/meng/asdasd.git
git push -u origin --all
git push -u origin --tags

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • git branch 查看本地所有分支 git status 查看当前状态 git commit 提交 git b...
    猿万阅读 10,525评论 1 45
  • 1.git的安装 1.1 在Windows上安装Git msysgit是Windows版的Git,从https:/...
    落魂灬阅读 14,333评论 4 54
  • Git使用教程:https://blog.csdn.net/tgbus18990140382/article/de...
    SkTj阅读 7,772评论 1 11
  • 一、 Git 常用命令速查 git branch 查看本地所有分支 git status 查看当前状态 git c...
    LOVE_晴天阅读 6,815评论 0 10
  • Git 命令行学习笔记 Git 基础 基本原理 客户端并不是只提取最新版本的文件快照,而是把代码仓库完整的镜像下来...
    sunnyghx阅读 9,363评论 0 11