top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Do I need to have git backup

+1 vote
265 views

All the git repositories are on one git server in specific directory.
I would like to know what I need to backup in order to be able to make a success restore, in case my disk on the git server will crushed.

I would like to understand, after the user run on his local workstation 'git init / add / commit / push' all the information was copied to the git server and the local directory in the local workstation can be removed?

I can see somehow the name of the files and their content in the git repository that saved on the git server?

posted Oct 15, 2013 by Jai Prakash

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Depends on how you define "all the information": contrary to centralized systems, in Git, pushing is a voluntary act -- just like sharing, -- where the one who shares decides what they want to share. In the case of Git, a developer chooses which bits of their local commit graphs to send, and which objects to update with them.

Specifically:
* If you have recorded 10 commits on top of your local branch "X" which tracks a remote branch, you're not required to update the branch being tracked with all those 10 commits -- you might send, say, just the first three of them.
* Tags are not pushed unless git push is explicitly told to do that, and the tags to send are specified. Notes are not sent as well.
* New local branches are not pushed unless git push is told to do so.

On the other hand, what's sent, is sent completely and with all the dependent objects, so if someone pushes a commit into the repository, you can be sure everything this commit references in the repository it
has been created in, is also sent.

Note that what I have just described -- the freedom of the owner of a local repository in what they share -- is just a property of a DVCS you have to live with. But what ends up in your centralized ("shared") repository is self-consistent, and you can safely back it up.

What's pushed when a developer simply runs git push or git push in their repository is another story completely as it depends on a number of details. If you're interested about this, ask away.

I can see somehow the name of the files and their content in the git repository that saved on the git server?

Yes: the regular Git commands for inspecting the commit graphs work in bare repositories just as well as they do in "normal" ones.

answer Oct 15, 2013 by Anderson
Similar Questions
0 votes

If I create a git repo for multiple projects, for example ALL projects that my team works on, when they clone and pull, do they have to download all the files? Can they sort of selectively download the files they may want to read or work on?
The idea is I want to track a bunch of projects for my team ... so i was thinking to make a repo that contains something like this:

./MyTEAM/./MyTEAM/Project_A/
./MyTEAM/Project_A/Some_Files/
./MyTEAM/Project_A/Some_More_Files/
./MyTEAM/Project_B/
./MyTEAM/Project_C/

Then the entire team can contribute to any of the projects they may be working on, but they should not have to download every single file when they clone .. is that possible?
Basically I do not want to have to create a repo for every single project .. is that what people normally do?

0 votes

I work on some files and push/merge them to the remote server. Sometimes I get merge conflicts on those files and have to fix them. That's completely fine. I get that.

What I don't understand is that sometimes during this process I will get merge conflicts in files _I have never touched_. In fact they are in a completely different series of directories to the one I am working on and someone else project entirely. How am I meant to know how to fix these? I dont know what the other developer wanted to do and if they have done it right.

I thought git only merged/pushed the files you have changed? If someone else has changed Group A files on the remote repo, why must I change my local Group A files when I am _pushing _completely different set of Group B files?

Sure, Id understand if I were pulling files down to my local and had to resolve merge conflicts then, but this isn't happening when I push the files up.

Any help or advice is much appreciated. Sorry if I sound frustrated - I am really trying hard to get my head round this whole git thing but its just so weird.

+2 votes

I have Multiple SKU of my application (eg Standard, Enterprise, Corporate), what is best or suggested git workflow for it? or I should manage it in separate folders as separate project with individual git standard flow ?

...