Questions tagged [repository]

Can refer to the data store of a version control system containing the whole history of a project, or to an object that transfers data between the business layer of an application and its data store.

A repository is an object that transfers data between the business layer of an application and its data store. It appears to the developer-user as a factory that generates objects or collections in response to queries. Updated objects and collections can be passed back to the repository for persistence to the data store.

A Repository provides a clean separation between business and persistence logic. Repositories are often used with Object/Relational Management (ORM) frameworks. A repository can simply wrap the methods of an ORM, or it can provide a framework-neutral interface that isolates the business layer of the application from the ORM, allowing the ORM to be replaced at a later date without modification to the business layer.

The Repository Pattern is described by Martin Fowler in Patterns of Enterprise Application Software.

It can also be viewed as a:

  • Software Repository: a storage location from which software packages may be retrieved and installed on a computer.
  • Version Control Repository: an on-disk data structure which stores metadata for a set of files and/or directory structure.

See also:

9104 questions
25854
votes
105 answers

How do I undo the most recent local commits in Git?

I accidentally committed the wrong files to Git, but didn't push the commit to the server yet. How do I undo those commits from the local repository?
Hamza Yerlikaya
  • 49,047
  • 44
  • 147
  • 241
5550
votes
18 answers

How do I push a new local branch to a remote Git repository and track it too?

How do I: Create a local branch from another branch (via git branch or git checkout -b). Push the local branch to the remote repository (i.e. publish), but make it trackable so that git pull and git push will work.
Roni Yaniv
  • 57,651
  • 5
  • 19
  • 16
4643
votes
31 answers

How do I update or sync a forked repository on GitHub?

I forked a project, made changes, and created a pull request which was accepted. New commits were later added to the repository. How do I get those commits into my fork?
Lea Hayes
  • 62,536
  • 16
  • 62
  • 111
3791
votes
14 answers

Remove a file from a Git repository without deleting it from the local filesystem

I want to remove a file from my repository. git rm file_to_remove.txt will remove the file from the repository, but it will also remove the file from the local file system. How do I remove this file from the repo without deleting my local copy of…
mveerman
  • 38,827
  • 3
  • 22
  • 14
2981
votes
20 answers

How do I clone a Git repository into a specific folder?

The command git clone git@github.com:whatever creates a directory named whatever containing a Git repository: ./ whatever/ .git I want the contents of the Git repository cloned into my current directory ./ instead: ./ .git
David Smith
  • 38,044
  • 11
  • 44
  • 61
2187
votes
26 answers

How do you merge two Git repositories?

Consider the following scenario: I have developed a small experimental project A in its own Git repo. It has now matured, and I'd like A to be part of larger project B, which has its own big repository. I'd now like to add A as a subdirectory of…
static_rtti
  • 53,760
  • 47
  • 136
  • 192
1972
votes
31 answers

How do I clone a subdirectory only of a Git repository?

I have my Git repository which, at the root, has two sub directories: /finisht /static When this was in SVN, /finisht was checked out in one place, while /static was checked out elsewhere, like so: svn co…
Nick Sergeant
  • 35,843
  • 12
  • 36
  • 44
1875
votes
43 answers

Download a single folder or directory from a GitHub repo

How can I download only a specific folder or directory from a remote Git repo hosted on GitHub? Say the example GitHub repo lives here: git@github.com:foobar/Test.git Its directory structure: Test/ ├── foo/ │ ├── a.py │ └── b.py └── bar/ …
g_inherit
  • 18,771
  • 3
  • 16
  • 5
1475
votes
20 answers

How do I rename both a Git local and remote branch name?

I have a local branch master that points to a remote branch origin/regacy (oops, typo!). How do I rename the remote branch to origin/legacy or origin/master? I tried: git remote rename regacy legacy But this gave an error: error : Could not…
JayD
  • 15,483
  • 5
  • 15
  • 14
792
votes
10 answers

What is the difference between GitHub and gist?

What is the purpose of gist and how is it different from regular code sharing/maintaining using GitHub?
NSExplorer
  • 11,849
  • 12
  • 49
  • 62
694
votes
18 answers

How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning?

I tried to install a package, using install.packages("foobarbaz") but received the warning Warning message: package 'foobarbaz' is not available (for R version x.y.z) Why doesn't R think that the package is available? See also these questions…
Richie Cotton
  • 118,240
  • 47
  • 247
  • 360
647
votes
16 answers

How to move some files from one git repo to another (not a clone), preserving history

Our Git repositories started out as parts of a single monster SVN repository where the individual projects each had their own tree like so: project1/branches /tags /trunk project2/branches /tags /trunk Obviously, it…
ebneter
  • 20,795
  • 9
  • 30
  • 30
609
votes
24 answers

How to count total lines changed by a specific author in a Git repository?

Is there a command I can invoke which will count the lines changed by a specific author in a Git repository? I know that there must be ways to count the number of commits as Github does this for their Impact graph.
Gav
  • 11,062
  • 7
  • 33
  • 35
551
votes
10 answers

Untrack files from git temporarily

I have setup a local git on my machine. When I initialized git, I added pre-compiled libs and binaries. However, now during my development I don't want to check in those files intermittently. I dont want to remove these files from repo. Is there any…
agent.smith
  • 9,134
  • 9
  • 37
  • 49
425
votes
12 answers

How do I rename a repository on GitHub?

I wanted to rename one of my repositories on GitHub, but I got scared when a big red warning said: We will not set up any redirects from the old location You will need to update your local repositories to point to the new location Renaming may…
rabbid
  • 5,465
  • 7
  • 26
  • 37
1
2 3
99 100