Home git How does Git remote repository

How does Git remote repository

Author

Date

Category

With the lush from LAN to remote origin / master, everything will be filled with norms. I go to the remote server check, there is a commit.
In fact, files on a remote server that affected the push, not changed, and Git Status on the remote server shows these files in modified status.
I do not understand something? Why are files not changed? And how does modified?


Answer 1, Authority 100%

Storage (“repository”) Git is what you can see in the .git directory. Here are the contents of this directory in the newly created repository:

$ tree .git
.git.
├── Branches
├── Config
├── Description.
├── Head.
├── Hooks
│ & nbsp; & nbsp; ├── ApplyPatch-MSG.Sample
│ & nbsp; & nbsp; ├── COMMIT-MSG.SAMPLE
│ & nbsp; & nbsp; ├── FSMonitor-Watchman.Sample
│ & nbsp; & nbsp; ├── POST-Update.Sample
│ & nbsp; & nbsp; ├── Pre-applypatch.sample
│ & nbsp; & nbsp; ├── PRE-COMMIT.SAMPLE
│ & nbsp; & nbsp; ├── PREPARE-COMMIT-MSG.SAMPLE
│ & nbsp; & nbsp; ├── Pre-Push.Sample
│ & nbsp; & nbsp; ├── Pre-rebase.sample
│ & nbsp; & nbsp; ├── Pre-Receive.Sample
│ & nbsp; & nbsp; └── Update.sample
├── info
│ & nbsp; & nbsp; └── EXCLUDE.
├── Objects.
│ & nbsp; & nbsp; ├── info
│ & nbsp; & nbsp; └── Pack
└── Refs.
  ├── Heads.
  └── Tags

In the .git / objects directory, objects are stored (Types of Commit, Tree, Blob), from which you can remove the contents of those files that make up your project. These files for the repository are a purely optional thing. Without them, the storage is perfectly functioning (a bright example you can watch on the github.com server). But you need these files for work . They are called because “working copy / tree / catalog” (“Working Copy / Tree / Directory”).

When you “Fall” into a remote repository, the GIT program transmits objects .

If from the storage objects to which you have passed a new portion of objects, the “workflow” was once unfolded, then, of course, no update files in this copy will happen. The files that make up the “workflow” will be suspended with the state of the repository itself.

To avoid such a distance, the GIT program default refuses to “enjoy” to the repository from which the “workflow” is deployed (to bypass this restriction, it is required to change the configuration of such a storage).

Normal practice is the transfer of objects to the storage>without “Workpies” (so-called bare-repository), from which subjects subsequently (command Pull ) are closed in the repository with “Working Copy”. Where new contents are extracting from objects for the “Working Cap” files.

Judging by the above in the question, this normal practice is violated. It is better for example, of course, but if nothing depends on you here, then you can bring the contents of the “Working” files to that condition, which is contained in the storage facilities, you can, for example, by the command:

$ Git Reset --hard

Be careful and cautious: This command will raise all local changes in the “Working Copy” files.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions