Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3272714
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:51:17+00:00 2026-05-17T18:51:17+00:00

I’ve got some trouble with a git setup I wanted to use in our

  • 0

I’ve got some trouble with a git setup I wanted to use in our company.

I set up a git “server” with the main code repository on a ubuntu hardy machine with git 1.5.4.3.
I’m new to git and set up this repository step by step with tutorial.

git init
git add .
git commit -m "initial commit"

Then I set up a client (Win XP) git install with version 1.7.3.1.msysgit.0 (official git for windows) and cloned that repository over ssh.

git clone <IP>:/var/git/<repo> <target>
<made some file changes>
git status ob my client then says:

$ git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   searchfunc_admin.php
#
no changes added to commit (use "git add" and/or "git commit -a")

then I do a commit -a which gives:

[master 9404d01] + searchfunc_admin.php DB Verb. Prüfung modifiziert
 1 files changed, 3 insertions(+), 3 deletions(-)

an then I push to the repository on the server:

$ git push origin master
<user>@<IP>'s password:
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 385 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
To 192.168.1.26:/var/git/farocmsafs
   5267756..9404d01  master -> master

On the ubuntu machine, I cd to the master repo and check what happened:

git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   searchfunc_admin.php
#

If I check the DIFF, it shows the changes but they are handled as old code that should be updated with the original code (which is the real old code)

git diff HEAD
diff --git a/searchfunc_admin.php b/searchfunc_admin.php
index 4e15696..17ca17a 100755
--- a/searchfunc_admin.php
+++ b/searchfunc_admin.php
@@ -9,11 +9,11 @@ require_once("additional/functions.php");
 // INITS
 //**********
 // Connect to database
-if(!$mylocal || !$myafs)
+if($DB_CONNECTION != TRUE)
 {
-       if(!sqldb_connect())
+       if(($sql_return = sqldb_connect()) != TRUE)
        {
-               echo "Cant connect to database";
+               echo "Cant connect to database: ".$sql_return;
                die(1);
        }
 }

If I execute git commit he ask me for the message, commits, but no changes of the new pushed code are applied.

I’ve found out that my only chance to apply the new changes is a git reset –hard with the remote commit ID. But that way I have to apply all changes to the code by hand.

I don’t use other branches, only “master” and don’t use git commit with any other parameters than “-a” so I don’t have any clue where the origin of that error is.

From what I’ve read so far, this could be a detached HEAD problem, but I don’t know why the head is detached.
If I made local changes on the ubuntu machine, all goes well. I can commit and see the changes on my remote machine after a fetch or pull. But I’m unable to apply remote changes other that with reset –hard.

Hope Someone can help me with this.

Best Regards, Sebastian

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:51:18+00:00Added an answer on May 17, 2026 at 6:51 pm

    Don’t push to a non-bare repository. It will update the head but not the working tree, leading to weird behavior when you look at it later. You can fix it by doing a git reset --hard to update the working tree on the server to the current head.

    There are two ways to fix this:

    1. Initialize a new repository on the server with git init --bare
    2. Clear out the working tree on the server and move the entire contents of the .git subdir to the top-level. You should probably rename the repository so it ends with .git, as that is customary for bare repositories.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.