大容量github代码拉取处理方式

 

# mkdir projectName

# cd projectName

# git init

# git fetch https://github.com/projectName.git  

//修改.git中config的url再执行下面语句

# git checkout FETCH_HEAD

# git fetch origin branchName

# git checkout branchName

//推送到自己的仓库项目

# git push --mirror http://mygit.com/my/myProject.git

//clone myProject

# git clone --depth 1 http://mygit.com/my/myProject.git

//切换到master分支

# git merge remotes/origin/branchName --allow-unreclated-histories

=======================

修改“.git”文件夹里面的“config”文件的url:

[core]

        repositoryformatversion = 0

        filemode = true

        bare = false

        logallrefupdates = true

        ignorecase = true

        precomposeunicode = false

[remote "origin"]

        url = https://github.com/checkfrank/checkfrank.github.io.git

        fetch = +refs/heads/*:refs/remotes/origin/*

        pushurl = https://github.com/checkfrank/checkfrank.github.io.git

[branch "master"]

        remote = origin

        merge = refs/heads/master

把其中换成你项目的地址就可以了:

url = https://github.com/CrossLee/xxx.git

pushurl = https://github.com/CrossLee/xxx.git

===================================

To fetch a branch, you simply need to:

git fetch origin

This will fetch all of the remote branches for you. You can see the branches available for checkout with:

git branch -v -a

With the remote branches in hand, you now need to check out the branch you are interested in, giving you a local working copy:

git checkout -b test origin/test

 

转载于:https://my.oschina.net/u/199525/blog/826662

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值