Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You get the error message because you push into a non-bare repository; see <a href="https://git.wiki.kernel.org/index.php/GitFaq#Why_won.27t_I_see_changes_in_the_remote_repo_after_.22git_push.22.3F" rel="nofollow">the Git FAQ</a> for some details. The short solution is: Don't push into an git repository with a working directory; but use an bare repository as intermediary.</p> <p>When you push into a branch, git updates the branch to reflect the new state of the branch. What it does not update are the index and the working directory (because you might have changes there and you would not be able to resolve conflicts anyway, from remote).</p> <p>In your example, this means the following:</p> <ul> <li>Initially, A and B have the same master branch</li> <li>You add a file F in A's master branch, commit this change and push it to B's master branch</li> <li>Now, B's master branch (which is checked out at the moment) contains F. But as git didn't touch B's working directory, F does not exist there</li> <li>Hence, in B, git reports the file F as deleted: It is present in the HEAD commit, but not in the working directory.</li> </ul> <p>As to your question about data-loss: You do not lose any data with this push. But, if you had any changes in your working directory, it might be hard to identify them, as <code>git diff</code> now shows the diff against the <em>new</em> state of branch. So, some of the changes are real changes, some of the changes are only displayed because the checkout was never updated to the current version</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload