# 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