Git Push - Not working -
i relative new git , wanted test out. webhosting allows git via ssh , found tutorials, stuck. sorry in first place if question sound stupid.
what did:
logged remote webhost via ssh , initialized new git project:
git init git add . git commit -m 'version 1.0.0'
this outputted me long list of files, have been updated.
i cloned repository on local computer , created new file "index2.php"
git clone xxx.git cp index.php index2.php git add index2.php git commit -m "index2.php added"
then tried push new "index2.php" file onto server. got error had set on remote server
git config receive.denycurrentbranch ignore
git push origin master counting objects: 2, done. delta compression using 4 threads. compressing objects: 100% (2/2), done. writing objects: 100% (2/2), 231 bytes | 0 bytes/s, done. total 2 (delta 1), reused 0 (delta 0) ssh://xxx.git 1b79ddf..1cfe422 master -> master
seems files have been pushed. when ls -l on remote server new file "index2.php" not there. why? have forgotten something?
update: when git status on remote server following:
git status on branch master changes not staged commit: (use "git add/rm <file>..." update committed) (use "git checkout -- <file>..." discard changes in working directory) deleted: index2.php
what mean?
i assume able see "index2.php added" commit when git log
on remote server. correct me if wrong. these things can do.
check if index2.php present in actual git repo pushed.
do
git pull
on remote server latest commits pushed.
edit 1:
that means there no remote configured on remote. need git remote add origin xxx.git
in remote server
here's has happened.
you initialized empty git repo on remote server , added commit. haven't pushed changes git server. remote server not connected git server. if observe, doing git log
on local not show commit did on remote server.
Comments
Post a Comment