2021-04-18 10:23:24 +00:00
<!DOCTYPE html>
< html lang = "en" >
< head >
< meta charset = "utf-8" >
< title > YBlog - Git Tips< / title >
< meta name = "keywords" content = "git, tip" / >
< link rel = "shortcut icon" type = "image/x-icon" href = "../../../../Scratch/img/favicon.ico" / >
2021-05-25 20:25:47 +00:00
< link rel = "stylesheet" type = "text/css" href = "/css/y.css" / >
< link rel = "stylesheet" type = "text/css" href = "/css/legacy.css" / >
< link rel = "alternate" type = "application/rss+xml" title = "RSS" href = "/rss.xml" / >
2021-04-18 10:23:24 +00:00
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" >
< link rel = "apple-touch-icon" href = "../../../../Scratch/img/about/FlatAvatar@2x.png" / >
<!-- [if lt IE 9]>
< script src = "http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js" > < / script >
<![endif]-->
<!-- IndieAuth -->
2023-06-30 20:54:00 +00:00
< link href = "https://ieji.de/@yogsototh" rel = "me" >
2021-04-18 10:23:24 +00:00
< link href = "https://github.com/yogsototh" rel = "me" >
< link href = "mailto:yann.esposito@gmail.com" rel = "me" >
< link rel = "pgpkey" href = "../../../../pubkey.txt" >
< / head >
< body lang = "en" class = "article" >
< div id = "content" >
< div id = "header" >
< div id = "choix" >
< span id = "choixlang" >
< a href = "../../../../Scratch/fr/blog/2010-03-22-Git-Tips/" > French< / a >
< / span >
< span class = "tomenu" > < a href = "#navigation" > ↓ Menu ↓< / a > < / span >
< span class = "flush" > < / span >
< / div >
< / div >
< div id = "titre" >
< h1 > Git Tips< / h1 >
< / div >
< div class = "flush" > < / div >
< div id = "afterheader" class = "article" >
< div class = "corps" >
< h2 id = "clone-from-github-behind-an-evil-firewall" > clone from github behind an evil firewall< / h2 >
< p > Standard:< / p >
< div >
< code class = "zsh" > git clone git@github.com:yogsototh/project.git < / code >
< / div >
< p > Using HTTPS port:< / p >
< div >
< code class = "zsh" > git clone git+ssh://git@github.com:443/yogsototh/project.git < / code >
< / div >
< h2 id = "clone-all-branches" > clone all branches< / h2 >
< p > < code > git clone< / code > can only fetch the master branch.< / p >
< p > If you don’ t have much branches, you can simply use clone your project and then use the following command:< / p >
< div >
< code class = "zsh" > git branch – track local_branch remote_branch < / code >
< / div >
for example:
< div >
< code class = "zsh" > $ git clone git@github:yogsototh/example.git $ git branch master < em > $ git branch -a master < / em > remotes/origin/HEAD -> origin/master remotes/origin/experimental $ git branch – track experimental remotes/origin/experimental $ git branch master * experimental < / code >
< / div >
< p > If you have many branches it can be useful to use the following < em > script< / em > /< em > long command line< / em > .< / p >
< div >
< p > < code class = "zsh" > # first clone your project $ git clone git@github.com:yogsototh/project.git< / p >
< h1 id = "copy-all-branches" > copy all branches< / h1 >
$ zsh $ cd project $ for br in $( git br -a ); do case $br in remotes/< em > ) print $br ; case ${br:t} in master|HEAD) continue ;; < / em > ) git branch – track ${br:t} $br ;; esac ;; esac done < / code >
< / div >
< / div >
< div id = "afterarticle" >
< div id = "social" >
2021-05-25 20:25:47 +00:00
< a href = "/rss.xml" target = "_blank" rel = "noopener noreferrer nofollow" class = "social" > RSS< / a >
2021-04-18 10:23:24 +00:00
·
< a href = "https://twitter.com/home?status=http%3A%2F%2Fyannesposito.com/Scratch/en/blog/2010-03-22-Git-Tips/%20via%20@yogsototh" target = "_blank" rel = "noopener noreferrer nofollow" class = "social" > Tweet< / a >
·
< a href = "http://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fyannesposito.com/Scratch/en/blog/2010-03-22-Git-Tips/" target = "_blank" rel = "noopener noreferrer nofollow" class = "social" > FB< / a >
< br / >
< a class = "message" href = "../../../../Scratch/en/blog/Social-link-the-right-way/" > These social sharing links preserve your privacy< / a >
< / div >
< div id = "navigation" >
< a href = "../../../../" > Home< / a >
< span class = "sep" > ¦< / span >
< a href = "../../../../Scratch/en/blog" > Blog< / a >
< span class = "sep" > ¦< / span >
< a href = "../../../../Scratch/en/softwares" > Softwares< / a >
< span class = "sep" > ¦< / span >
2023-05-10 06:39:11 +00:00
< a href = "/about-me.html" > About< / a >
2021-04-18 10:23:24 +00:00
< / div >
< div id = "totop" > < a href = "#header" > ↑ Top ↑< / a > < / div >
< div id = "bottom" >
< div >
Published on 2010-03-22
< / div >
< div >
2023-06-30 20:54:00 +00:00
< a href = "https://ieji.de/@yogsototh" > Follow @yogsototh@ieji.de< / a >
2021-04-18 10:23:24 +00:00
< / div >
< div >
< a rel = "license" href = "http://creativecommons.org/licenses/by/3.0/deed.en_US" > Yann Esposito©< / a >
< / div >
< div >
Done with
< a href = "http://www.vim.org" target = "_blank" rel = "noopener noreferrer nofollow" > < strike > Vim< / strike > < / a >
< a href = "http://spacemacs.org" target = "_blank" rel = "noopener noreferrer nofollow" > spacemacs< / a >
< span class = "pala" > & < / span >
< a href = "http://nanoc.ws" target = "_blank" rel = "noopener noreferrer nofollow" > < strike > nanoc< / strike > < / a >
< a href = "http://jaspervdj.be/hakyll" target = "_blank" rel = "noopener noreferrer nofollow" > Hakyll< / a >
< / div >
2022-10-26 09:26:08 +00:00
2021-04-18 10:23:24 +00:00
< / div >
< / div >
< / div >
< / div >
< / body >
< / html >