关于Github删除一个repository, git bash中与Github连接

一 关于Github删除一个repository

关于Github删除一个repository, git bash中与Github连接_第1张图片
关于Github删除一个repository, git bash中与Github连接_第2张图片

git bash中关于远程库的操作

git中查看本地库中已连接的所有远程库的名字:(git remote)
git中删除本地库中已连接的远程库的名字:(git remote rm xxxx)

xxx@LAPTOP-HO9I9168 MINGW64 ~/git_file/learngit (master)
$ git remote
origin

xxx@LAPTOP-HO9I9168 MINGW64 ~/git_file/learngit (master)
$ git remote rm origin

xxx@LAPTOP-HO9I9168 MINGW64 ~/git_file/learngit (master)
$ git remote


本地库与Github连接(Push)

将本地库的文件push到远程库

xxx@LAPTOP-HO9I9168 MINGW64 ~/git_file/learngit (master)
$ git remote add re [email protected]:kechao123/git_study_kasan.git

xxx@LAPTOP-HO9I9168 MINGW64 ~/git_file/learngit (master)
$ git push -u re master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Delta compression using up to 4 threads
Compressing objects: 100% (1/1), done.
Writing objects: 100% (2/2), 196 bytes | 196.00 KiB/s, done.
Total 2 (delta 0), reused 0 (delta 0)
To github.com:kechao123/git_study_kasan.git
   bccd89e..8a2471e  master -> master
Branch 'master' set up to track remote branch 'master' from 're'.

xxx@LAPTOP-HO9I9168 MINGW64 ~/git_file/learngit (master)
$
//$ git push -u re master  中 -u 的作用用于第一次push本地库内容到github上(会建立本地master branch 与 远程库 master branch 相关联)
// 后面的push都不用加-u参数, 即: git push re master 

本地库与Github连接(Clone)

从远程库中Clone文件到本地库

kechao@LAPTOP-HO9I9168 MINGW64 ~/git_file/learngit (master)
$ ls

kechao@LAPTOP-HO9I9168 MINGW64 ~/git_file/learngit (master)
$ git clone [email protected]:kechao123/git_study_kasan.git
Cloning into 'git_study_kasan'...
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 8 (delta 0), reused 8 (delta 0), pack-reused 0
Receiving objects: 100% (8/8), done.

kechao@LAPTOP-HO9I9168 MINGW64 ~/git_file/learngit (master)
$ ls
git_study_kasan/


从远程库中Clone整个版本库(git_study_kasan)使用git Clone;
从远程库中更新本地库中的一个分支使用git pull
git pull相当于是从远程获取最新版本并merge(合并)到本地 git pull = git fetch + git mergegit fetch更安全一些

你可能感兴趣的:(git)