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:

8446 questions
16 answers

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

I want to be able to do the following: Create a local branch based on some other (remote or local) branch (via git branch or git checkout -b) Push the local branch to the remote repository (publish), but make it trackable so git pull and git push…
Roni Yaniv
  • 52,666
  • 5
  • 18
  • 16
31 answers

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

I forked a project, applied several fixes and created a pull request which was accepted. A few days later, another change was made by another contributor. So my fork doesn't contain that change. How can I get that change into my fork? Do I need to…
Lea Hayes
  • 59,010
  • 16
  • 56
  • 106
12 answers

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

My initial commit contained some log files. I've added *log to my .gitignore, and now I want to remove the log files from my repository. git rm mylogfile.log will remove a file from the repository, but will also remove it from the local file…
  • 35,543
  • 3
  • 20
  • 14
19 answers

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

Executing the command git clone creates a directory in my current folder named whatever, and drops the contents of the Git repository into that folder: /httpdocs/whatever/public My problem is that I need the contents of the…
David Smith
  • 35,118
  • 10
  • 40
  • 61
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…
  • 49,595
  • 45
  • 129
  • 185
24 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
  • 31,514
  • 12
  • 35
  • 44
42 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: Its directory structure: Test/ ├── foo/ │ ├── │ └── └── bar/ …
  • 15,591
  • 3
  • 14
  • 5
15 answers

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

I have four branches like master -> origin/regacy, FeatureA -> origin/FeatureA. As you can see, I typed the wrong name. So I want to rename a remote branch name (origin/regacy → origin/legacy or origin/master) I try the command below: git remote…
  • 10,483
  • 5
  • 14
  • 14
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?
  • 11,181
  • 12
  • 47
  • 62
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
  • 112,108
  • 43
  • 231
  • 350
17 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…
  • 19,017
  • 9
  • 28
  • 30
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.
  • 10,288
  • 7
  • 31
  • 35
9 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…
  • 8,616
  • 8
  • 33
  • 46
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…
  • 4,945
  • 6
  • 24
  • 36
10 answers

How to generate a Dockerfile from an image?

Is it possible to generate a Dockerfile from an image? I want to know for two reasons: I can download images from the repository but would like to see the recipe that generated them. I like the idea of saving snapshots, but once I am done it would…
  • 4,583
  • 5
  • 18
  • 30
2 3
99 100