美文网首页
2019-03-11 Git远程仓库

2019-03-11 Git远程仓库

作者: 阿丧小威 | 来源:发表于2019-03-17 00:05 被阅读0次

1. 常用命令

常用命令

2. 远程管理

克隆git下载地址
[root@localhost mnt]# git clone https://github.com/goodboy23/shell-script-collection.git    ---把代码库从远程拉到本地上
Cloning into 'shell-script-collection'...
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 1086 (delta 1), reused 0 (delta 0), pack-reused 1079
Receiving objects: 100% (1086/1086), 344.99 KiB | 84.00 KiB/s, done.
Resolving deltas: 100% (707/707), done.
Checking connectivity... done.
[root@localhost mnt]# ll
total 4
drwxr-xr-x. 8 root root 4096 Mar  3 00:25 shell-script-collection
[root@localhost shell-script-collection]# ll
total 24
drwxr-xr-x. 2 root root   20 Mar  3 00:25 conf
drwxr-xr-x. 2 root root   53 Mar  3 00:25 lib
drwxr-xr-x. 2 root root 4096 Mar  3 00:25 material
drwxr-xr-x. 2 root root   30 Mar  3 00:25 package
-rw-r--r--. 1 root root 2612 Mar  3 00:25 README.md
drwxr-xr-x. 2 root root 4096 Mar  3 00:25 script
-rwxr-xr-x. 1 root root 9182 Mar  3 00:25 ssc.sh
[root@localhost shell-script-collection]# git status
On branch master    ---本身就是一个库,当前在master上
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
[root@localhost shell-script-collection]# vi README.md     ---随便添加点东西保存
[root@localhost shell-script-collection]# git add .    ---把工作时的所有变化提交到暂存区,包括文件内容修改(modified)以及新文件(new),但不包括被删除的文件
[root@localhost shell-script-collection]# git commit -m "README update"    ---提交代码到本地仓库
[master 711a0d8] README update
 1 file changed, 1 insertion(+)
[root@localhost shell-script-collection]# git remote    ---列出已经存在的远程分支,其中origin为默认的远程版本库名称
origin
[root@localhost shell-script-collection]# git remote -v
origin  https://github.com/goodboy23/shell-script-collection.git (fetch)    ---fetch是拉代码下来
origin  https://github.com/goodboy23/shell-script-collection.git (push)    ---push是传代码上去
[root@localhost shell-script-collection]# git remote add gitlab 192.168.9.111/zheng.git    ---添加远程库
[root@localhost shell-script-collection]# git remote add git 192.168.9.222/zheng.git
[root@localhost shell-script-collection]# git remote -v
git 192.168.9.222/zheng.git (fetch)
git 192.168.9.222/zheng.git (push)
gitlab  192.168.9.111/zheng.git (fetch)
gitlab  192.168.9.111/zheng.git (push)
origin  https://github.com/goodboy23/shell-script-collection.git (fetch)
origin  https://github.com/goodboy23/shell-script-collection.git (push)
远程管理

3. 标签管理

[root@localhost shell-script-collection]# git tag    ---查看标签
1.2
V1.2
v1.0
v1.1
v1.2
[root@localhost shell-script-collection]# git tag -a v1.3 -m "feature finished"    ---新建标签,-m后面为注释
[root@localhost shell-script-collection]# git tag
1.2
V1.2
v1.0
v1.1
v1.2
v1.3
标签管理

相关文章

  • Git远程配置

    Git远程查看  Git查看远程仓库 Git远程参数 Git配置远程仓库

  • 2018-05-14

    删除远程分支: git push 远程仓库 --delete 远程分支 git push 远程仓库:远程分支 本地...

  • Git

    删除远程 Git 仓库 git remote rm origin 添加远程 Git 仓库 git remote a...

  • Git 入门到放弃

    简介 git关联远程仓库 本地仓库与远程仓库同步问题 Git 终端命令 git关联远程仓库 基本流程 注册gith...

  • git 仓库

    git 初始化 初始化git init git 新建 git 仓库,关联远程仓库 关联远程仓库git remote...

  • Git常用命令大全

    // 初始化仓库 git init //从远程仓库克隆 git clone // 关联远程仓库 git remot...

  • 通过Git将本地项目和远程仓库做关联

    添加远程代码仓库: git remote add origin 远程仓库地址 提交代码到远程仓库: git pus...

  • git 查看、添加、删除 远程仓库

    查看远程仓库地址git remote -v(去掉-v可查看远程仓库名 ) 添加远程仓库地址git remote a...

  • git 命令行操作笔记

    git中的选项解释 创建本地git仓库 提交代码到git仓库 本地git仓库添加到远程仓库中 克隆远程仓库到本地 ...

  • git关联远程仓库

    git关联远程仓库 添加远程仓库:git remote add origin git@github.com:exa...

网友评论

      本文标题:2019-03-11 Git远程仓库

      本文链接:https://www.haomeiwen.com/subject/fkmipqtx.html