1

I have master repository at server and i have local clone from this.

I do at local: change test.txt

git add test.txt
git commit -m 'test'
git push origin master

after this i dont see changes at test.txt. at git status i see

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

    modified:   test.txt

i try

git merge _commitname

and see:

Already up-to-date.

thanks in advance and sorry for bad english.

UPD

git version 1.8.5.3 – at server
git version 1.8.5.2.msysgit – at client

diff:

--- test.txt 
+++ test.txt 
...[characters from test.txt]
Saska
  • 1,021
  • 6
  • 19
  • 32
  • What OS and what git version are you using? What `git branch` returns (do you see a '`*`' in front of master?) – VonC Feb 04 '14 at 06:59
  • [user@...]# git branch b145ecfc72ec5222e406578c0a280d9b01670944 * master – Saska Feb 04 '14 at 07:07
  • Ok. What does `git --version` returns? And do you see your changes when doing a `git diff HEAD~ HEAD -- test.txt`? – VonC Feb 04 '14 at 07:10
  • git version 1.8.5.3 – at server git version 1.8.5.2.msysgit – at client diff: --- test.txt +++ test.txt ...[characters from test.txt] – Saska Feb 04 '14 at 07:13
  • yes, i see my changes. in git diff, i mean – Saska Feb 04 '14 at 07:29
  • Do you see those changes on your Widows client? When you say "I dont see changes at `test.txt`", do you mean at your Debian server? – VonC Feb 04 '14 at 07:32
  • yes, i dont see changes at file on server, but see in git diff and in git log. in client i do changes and see it, of course. – Saska Feb 04 '14 at 07:39
  • But when you are pushing to the server, you are pushing to a bare repo, right? (a folder which ends with '`.git`': `myrepo.git`) So you wouldn't see *any* file in that repo. – VonC Feb 04 '14 at 07:40
  • okay, its very sad, but thanks) – Saska Feb 04 '14 at 07:54

2 Answers2

1

The issue seems to be seen on the destination, that is the server side.

The OP don't see the modification on the server side either because because:

  • the destination repo is non-bare (in which case the working tree isn't updated)
  • the destination repo is bare (in which case there is no file to see since it is a repo without working tree)
    That last case is usually completed by a post-receive hook in order to checkout that repo in a separate folder, in order to see what has just been pushed.
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

It was non-bare repository with 1 branch (master)

i created new branch

git branch new

push commit from local repository

git push origin master:new

and do merge

git merge new
Saska
  • 1,021
  • 6
  • 19
  • 32
  • That can work indeed. +1. Pushing to a non-bare repo, to a branch which is *not* checked out is a legitimate push. – VonC Feb 04 '14 at 10:37