I am using github and I have a few branches made from a backup branch and I am trying to git clone from the sub branch lets call it "x". I have made a lot of changes and pushed them to the "x" branch but now when I git clone, it pulls that branch + the backup branch. Is there a way to only clone from the "x" branch without git cloning its parent branch? On git the "x" branch looks exactly how I want it and some things are deleted that are in the backup branch however git clone sends those deleted files as well. I am a little confused and I hope this is a simple git clone "url" addition. Thank you anyone who knows what I need to do to only clone the "x" branch.
            Asked
            
        
        
            Active
            
        
            Viewed 27 times
        
    0
            
            
        - 
                    Possible duplicate, take a look at http://stackoverflow.com/questions/1911109/clone-a-specific-git-branch. – ericsaupe Aug 14 '14 at 17:33
- 
                    Copy the url on HTTPS clone URL and run: git clone https://github.com/Sample/repoename.git – neo Aug 14 '14 at 17:46
- 
                    so that usually works but to desclose the parent branch you have to run: – ZachyBear Aug 14 '14 at 19:35
1 Answers
0
            
            
        This is what I had to run.
git clone -b branchName --single-branch https://github.com/clone.url
Hope this helps someone
 
    
    
        ZachyBear
        
- 297
- 3
- 15