LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-24-2014, 02:38 AM   #1
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 445

Rep: Reputation: 18
How to get a just specific checkout of a git repo not all of it


Hi
How can I get just specific checkout of a git repo not all of it with git command line?
 
Old 02-24-2014, 05:39 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
you would need to specify what do you really mean by that. In general you can checkout a given state of the repo. This will define all the available (visible) files and their versions as well.
 
Old 02-25-2014, 12:16 AM   #3
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 445

Original Poster
Rep: Reputation: 18
I mean there is a git repo on remote and I have nothing of it localy but I do not want to get all of it I just want a branch of it or a specific commit of the repo . your answer was about a repo that localy exists which I knew it and is not my qurstion.
thanks
 
Old 02-25-2014, 02:32 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
git-clone has an option to clone only a single branch. In that case your local repo will contain commits only related to that branch. But anyway you can only checkout a full set (of files) of a selected commit.
 
1 members found this post helpful.
Old 02-26-2014, 01:35 AM   #5
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 445

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by pan64 View Post
git-clone has an option to clone only a single branch. In that case your local repo will contain commits only related to that branch. But anyway you can only checkout a full set (of files) of a selected commit.
thanks but what is that option in git clone?
 
Old 02-26-2014, 01:44 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
git clone --single-branch
since git 1.7.10 I think
http://stackoverflow.com/questions/1...-branch-in-git
 
Old 03-06-2014, 12:07 AM   #7
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 445

Original Poster
Rep: Reputation: 18
does it work for a specific commit ?
 
Old 03-06-2014, 12:43 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
what do you mean by that? you cannot clone a commit but a branch or the whole repo.
 
Old 03-09-2014, 08:22 AM   #9
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 445

Original Poster
Rep: Reputation: 18
I mean how can I get files of a specific commit?
 
Old 03-09-2014, 08:29 AM   #10
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
you need to download (clone) the repo, or at least a branch to get any files. Remember every commit will change the state of the repo and you can only have access to those states (by setting HEAD) - containing all the files belonging to that state, and not the change itself.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to git clone/checkout only x86_64 architecture masuch Linux - Newbie 6 07-02-2012 06:02 PM
[SOLVED] Trying to split a large SVN repo into one git repo. Ian John Locke II Linux - Software 1 01-30-2012 08:19 AM
[SOLVED] Can't install Git repo (I don't git git ) Nemus Linux - Software 3 05-20-2011 02:09 PM
Best way to automate copying of Git repo to subversion repo? jceipek Linux - Server 0 03-15-2011 02:42 AM
[SOLVED] git checkout error tkmsr Linux - General 2 06-23-2010 05:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration