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:

8107 questions
282
votes
2 answers

Repository Pattern Step by Step Explanation

Can someone please explain to me the Repository Pattern in .NET, step by step giving a very simple example or demo. I know this is a very common question but so far I haven't found a satisfactory answer.
Sa Patil
  • 2,997
  • 2
  • 11
  • 4
279
votes
7 answers

Project vs Repository in GitHub

In GitHub, what is the conceptual difference between a project (that can be created inside a repository) and a repository? I've seen several similar questions (here, here and here) in SO, but none of them explains what is a GitHub project, what is…
carlossierra
  • 3,639
  • 4
  • 16
  • 28
268
votes
10 answers

How do I make a Git commit in the past?

I'm converting everything over to Git for my own personal use and I found some old versions of a file already in the repository. How do I commit it to the history in the correct order according the file's "date modified" so I have an accurate…
unknown
  • 2,691
  • 3
  • 14
  • 7
267
votes
3 answers

If I fork someone else's private Github repo into my account, is it going to appear in my account as a public repo?

Someone gave me access to one of their private repo on Github. What I want to do is to fork that project into my own account, so I could make use of Github's pull request feature. I only have a basic account on Github, so I cannot make private repos…
Terence Ponce
  • 8,092
  • 8
  • 26
  • 35
252
votes
2 answers

Git error: src refspec master does not match any

I need to create a repo named carboncake. I tried this: Cloned the gitosis-admin repository to my local machine $ git clone gitosis@myserver.net:repositories/gitosis-admin.git $ cd gitosis-admin $ vim gitosis.conf Added the [repo carboncake] and…
Mithun Sreedharan
  • 45,549
  • 69
  • 171
  • 232
240
votes
8 answers

Transfer git repositories from GitLab to GitHub - can we, how to and pitfalls (if any)?

Can one transfer repositories from GitLab to GitHub if the need be. If so, how exactly can I go about doing the same? Also, are there any pitfalls in doing so or precautionary measures that I need to keep in mind before doing so given that I may…
boddhisattva
  • 5,836
  • 9
  • 44
  • 71
238
votes
5 answers

Git: Merge a Remote branch locally

I've pulled all remote branches via git fetch --all. I can see the branch I'd like to merge via git branch -a as remotes/origin/branchname. Problem is it is not accessible. I can't merge or checkout.
micahblu
  • 3,916
  • 4
  • 24
  • 31
232
votes
11 answers

What's the -practical- difference between a Bare and non-Bare repository?

I've been reading about the bare and non-bare / default repositores in Git. I haven't been able to understand quite well (theoretically) about the differences between them, and why I should "push" to a bare repository. Here's the deal: Currently,…
AeroCross
  • 3,504
  • 2
  • 20
  • 29
230
votes
14 answers

can you host a private repository for your organization to use with npm?

Npm sounds like a great platform to use within an organization, curious if a private repo is possible, like with Nexus/Maven. Nothing comes up on Google :(
adam
  • 3,617
  • 2
  • 17
  • 15
230
votes
24 answers

How to upload a project to Github

After checking Upload my project to github I still have no idea how to get a project uploaded to my Git Hub repository. I'm new to GitHub and I have no idea what to do. I created a repository but i want to upload my project to it. I've looked on the…
jampez77
  • 4,071
  • 7
  • 26
  • 48
226
votes
9 answers

How to remove the first commit in git?

I am curious about how to remove the first commit in git. What is the revision before committing any thing? Does this revision have a name or tag?
Weihang Jian
  • 5,390
  • 4
  • 33
  • 47
221
votes
7 answers

Can a project have multiple origins?

Can a project have two (or more) "origins" in Git? I would like to push a single project to both github and a Heroku server. Specifically, this error appears when adding the github repository: $ git remote add origin…
Chris Dutrow
  • 42,732
  • 59
  • 174
  • 243
191
votes
2 answers

Gradle buildscript dependencies

What is the difference between declaring repositories in the buildScript section of the gradle build or in the root level of the build. Option 1: build.gradle: buildScript { repositories { mavenCentral(); …
Jeff Storey
  • 53,386
  • 69
  • 224
  • 390
189
votes
6 answers

Can I arrange repositories into folders on Github?

I am new to git and what I am doing now is to upload all my recent projects as repositories to github. There are a lot of different projects like webdesign, wordpress themes and different types of applications. And some of these also belong to…
danijar
  • 27,743
  • 34
  • 143
  • 257
176
votes
17 answers

How do you get the Git repository's name in some Git repository?

When you are working in some Git directory, how can you get the Git repository name in some Git repository? Are there any Git commands? # I did check out bar repository and working in somewhere # under bar directory at this moment such as below. $…
diveintohacking
  • 3,523
  • 5
  • 24
  • 39