2017-01-01 1 views
0

ターゲット:/ var/www/html/wpをリモートgithubリポジトリのnewstartにプッシュする。WordPressのディレクトリをリモートgithubリポジトリにプッシュできないのはなぜですか?

ssh -T [email protected] 
You've successfully authenticated, but GitHub does not provide shell access. 

sshとgithubは良好な状態です。 1.Toリモート

はgithubのWebページでnewstartという名前の新しいプロジェクトを作成します。 SRC refspecマスター:原点マスター
エラーを押し5.git

ローカル

2.cdの/ var/WWWW/HTML/WP
3.sudoのgitのinit
4.git *
を追加いずれにも一致しません。
エラー:一部の参考文献を「原点」にプッシュできませんでした。

ありがとうございました。

git commit -m "First commit" 
git remote add origin git+ssh://[email protected]/someone/newstart.git 

git push origin master 
To git+ssh://[email protected]/someone/newstart.git 
! [rejected]  master -> master (fetch first) 
error: failed to push some refs to 'git+ssh://[email protected]/someone/newstart.git' 
hint: Updates were rejected because the remote contains work that you do 
hint: not have locally. This is usually caused by another repository pushing 
hint: to the same ref. You may want to first integrate the remote changes 
hint: (e.g., 'git pull ...') before pushing again. 
hint: See the 'Note about fast-forwards' in 'git push --help' for details. 

/var/www/html/wpをリモートgithubリポジトリにプッシュする方法は?

答えて

0
  1. あなたがコミットはgitませんでした。
  2. originが意味することをgitに伝えませんでした。 git pushコマンドで-fパラメータでfailed to push some refs to...

    $ git remote add origin remote repository URL 
    

参照命令here

+0

2つのコマンドが追加されました。新しい問題が発生します。 –

0

私はあなたが最初にgithubのにレポを作成する必要があると思う: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/

+0

お知らせを押して、この:「エラーを回避するには、使用して新しいリポジトリを初期化しないREADME、ライセンス、またはgitignoreファイル。プロジェクトの後にこれらのファイルを追加することができますGitHubにプッシュされました。おそらくREADME.mdなどがあります。 – fernand0

0

問題を解決するために、原点マスター -f 1.gitプッシュ:あなたは、にしています。
2.
はなぜのgit initをはsudoのgit initをを変更Gitの初期化にのinit はsudoのgitを変更するには?

.gitがはsudoのgit initをによって作成された場合、元のマスター -f gitのプッシュのための権限の問題があるでしょう。

ls -al . 
total 204 
drwxr-xr-x 6 www-data www-data 4096 Jan 1 19:42 . 
drwxr-xr-x 5 root  root  4096 Dec 12 22:27 .. 
drwxr-xr-x 8 root  root  4096 Jan 1 21:02 .git 

.gitがのgit initをによって作成された場合、そこは原点マスター -f gitのプッシュのための権限の問題ではないます。

ls -al . 
total 204 
drwxr-xr-x 6 www-data www-data 4096 Jan 1 19:42 . 
drwxr-xr-x 5 root  root  4096 Dec 12 22:27 .. 
drwxr-xr-x 8 debian8 debian8 4096 Jan 1 21:02 .git 

.gitディレクトリの所有権は、原点マスター -f Gitのプッシュを実行しなくなります。

今すぐ完了しました。

0

上記のエラーは、現在、リモートリポジトリと同期していないことを示しています。

同期

git pull --rebase 

git push origin <branch-name> 

If the push still does not work saying that remote does not exists. Add it.

git remote add origin <path/to/your/remote/repo> 
関連する問題