Git: Files pushed from local repo not showing up in remote git repo

Deadly 提交于 2020-01-11 04:05:10

问题


I'm brand new to git and am just starting to figure things out. I have been trying to figure out git on my remote dev server as well as my local machine. I have installed git successfully on both my remote server and my local machine (OSX). I am using a mac git client called Tower, here is my dilemma...

I can successfully create a bare repository on my remote server, no problems there. I then open up Tower and attempt to clone my remote repository to my local machine. I've been able to do that as well, I can successfully clone the remote repo to my local machine. However, whenever I add a new file to my local branch and then commit that change and push to the remote repo, it says it goes through successfully, but when I check my remote repo location, there are no new files there?

Tower says that the file exists in the remote repo, I can checkout that repo to a new local branch and it pulls the previous commit history and files like it should, but I can't find where the files are being stored on my remote repo.

What am I missing here? Any advice will be greatly appreciated, thanks!


回答1:


They are being stored as Git objects. Bare repositories do not have a working directory, so there will never be any files checked out on the server. The data is stored in Git's own content-addressable filesystem under the objects directory, keyed by the SHA1 hash of the objects' contents. Objects include blobs (file data), trees (lists of files and trees), and commits (metadata such as author name, timestamp, commit message, parent commit object IDs, and the tree object ID that corresponds to the commit).

(The objects may also be combined into packs, which will live under the objects/pack directory.)



来源:https://stackoverflow.com/questions/7219689/git-files-pushed-from-local-repo-not-showing-up-in-remote-git-repo

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!