Note that there are some explanatory texts on larger screens.

plurals
  1. POproblem with push changes to remote server
    primarykey
    data
    text
    <p>I have a problem with GIT repository. On the remote machine:</p> <pre><code>git init test.git &amp;&amp; cd test.git git config core.bare false git config receive.denycurrentbranch ignore </code></pre> <p>In <em>.git/hooks</em> I have push-update file:</p> <pre><code>#!/bin/sh # # This hook does two things: # # 1. update the "info" files that allow the list of references to be # queries over dumb transports such as http # # 2. if this repository looks like it is a non-bare repository, and # the checked-out branch is pushed to, then update the working copy. # This makes "push" function somewhat similarly to darcs and bzr. # # To enable this hook, make this file executable by "chmod +x post-update". #git update-server-info is_bare=$(git config --get --bool core.bare) if [ -z "$is_bare" ] then # for compatibility's sake, guess git_dir_full=$(cd $GIT_DIR; pwd) case $git_dir_full in */.git) is_bare=false;; *) is_bare=true;; esac fi update_wc() { ref=$1 echo "Push to checked out branch $ref" &gt;&amp;2 if [ ! -f $GIT_DIR/logs/HEAD ] then echo "E:push to non-bare repository requires a HEAD reflog" &gt;&amp;2 exit 1 fi if (cd $GIT_WORK_TREE; git-diff-files -q --exit-code &gt;/dev/null) then wc_dirty=0 else echo "W:unstaged changes found in working copy" &gt;&amp;2 wc_dirty=1 desc="working copy" fi if git diff-index --cached HEAD@{1} &gt;/dev/null then index_dirty=0 else echo "W:uncommitted, staged changes found" &gt;&amp;2 index_dirty=1 if [ -n "$desc" ] then desc="$desc and index" else desc="index" fi fi if [ "$wc_dirty" -ne 0 -o "$index_dirty" -ne 0 ] then new=$(git rev-parse HEAD) echo "W:stashing dirty $desc - see git-stash(1)" &gt;&amp;2 ( trap 'echo trapped $$; git symbolic-ref HEAD "'"$ref"'"' 2 3 13 15 ERR EXIT git-update-ref --no-deref HEAD HEAD@{1} cd $GIT_WORK_TREE git stash save "dirty $desc before update to $new"; git-symbolic-ref HEAD "$ref" ) fi # eye candy - show the WC updates :) echo "Updating working copy" &gt;&amp;2 (cd $GIT_WORK_TREE git-diff-index -R --name-status HEAD &gt;&amp;2 git-reset --hard HEAD) } if [ "$is_bare" = "false" ] then active_branch=`git symbolic-ref HEAD` export GIT_DIR=$(cd $GIT_DIR; pwd) GIT_WORK_TREE=${GIT_WORK_TREE-..} for ref do if [ "$ref" = "$active_branch" ] then update_wc $ref fi done fi </code></pre> <p>On local machine:</p> <pre><code>git init test.git touch file1.txt git add . git commit -m "Initial commit" git remote add origin ssh://&lt;REMOTE_REPO_ADDRESS&gt; git push origin master </code></pre> <p>After all this opertions I don't have any file on remote machine. When I use:</p> <pre><code>git status </code></pre> <p>I have:</p> <pre><code># On branch master # Changes to be committed: # (use "git reset HEAD &lt;file&gt;..." to unstage) # # deleted: file1.txt # </code></pre> <p>What am I doing wrong?</p> <p>When I add some teks to the file1.txt, commit changes second one and push it to remote machine then I see the file.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
 

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