是git的一种很好用的可视化工具,收费的。能够注册非商业用途无偿使用。注册地址 注意,使用git仓库用户的邮箱注册。若是注册邮箱和git仓库的用户邮箱不一致,会出现弹窗。linux
$ ssh-keygen -t rsa -C "yisangwu@hao123.com" -b 4096 # 使用git帐号生成密钥 $ cat ~/.ssh/id_rsa.pub # 复制公钥,添加到我的设置的ssh key里面。
```shell $ git init # 初始化一个新本地仓库 $ git remote add origin git_url # 创建和远程仓库的链接 $ git remote -v # 查看远程地址 $ git pull origin master # 拉取远程master分支
$ git remote set-url origin new_git_url
# branch_name 对应远程分支名 $ git pull origin branch_name --allow-unrelated-histories # 再进行 git 操做
有些git仓库代码过大,达到几个G,初始化clone或者fetch分支时,常常timeout,或者bad header。即便修改了git的配置,仍是会出现拉取失败!!git
# depth指定克隆深度,为1即表示只克隆最近一次commit $ git clone --depth 1 https://git123.com/group_name/coder.git $ git remote -r #查看远程分支, 此时看到的只有master $ git remote set-branches origin remote_branch_name # 添加远程分支 $ git fetch --depth 1 origin remote_branch_name # fetch远程分支,深度为1 $ git checkout remote_branch_name
$ git config core.filemode false # 在仓库目录下执行
$ git pull -p # 在仓库目录下执行