2014-08-29 183 views
0

我使用GitHub來維護我的項目。我的存儲庫有問題。它包含一個文件:Git不會將本地存儲庫與遠程存儲庫同步

public function download($download_path, $download_file) { 
    file_put_contents($download_path, $download_file); 
} 

當地的一個樣子:

public function download($path, $file) { 
    file_put_contents($path, $file); 
} 

雖然當我嘗試同步我的本地庫與遠程一個與git push它說:

Everything up-to-date

有什麼問題? git pull也不起作用(Already up-to-date.

+1

您是否在本地提交了更改? – Chris 2014-08-29 14:44:02

+0

@Chris我該怎麼做? – 2014-08-29 15:23:31

+0

取決於您使用的工具。在命令行中,像'git add the-file','git commit'。你說「我使用GitHub來維護我的項目」,但這實際上是Git所做的最基本的事情。也許你需要閱讀教程? – Chris 2014-08-29 15:45:32

回答

0

我固定它做:

git add .

然後我做:

git commit

它會打開你的默認編輯器,你應該鍵入提交信息,然後保存並關閉編輯。你會看到類似這樣的:

Counting objects: 1, done. 
Compressing objects: 100% (1/1), done. 
Writing objects: 100% (1/1), 1 bytes, done. 
Total 1 (delta 1), reused 0 (delta 0) 
To [email protected]:user/repository.git 
    9a4v59c..146v3qz master -> master 

然後我做了git pull & git push

0

看起來你還沒有在本地提交你的修改。

  1. 階段修改後的文件:

    git add path/to/the-file 
    
  2. 本地提交更改:

    git commit 
    
  3. 把你的改變GitHub上。假設你的GitHub的遠程調用origin

    git push origin master 
    

你可能要考慮讀一個Git教程。這裏是Atlassian's tutorials,這裏是GitHub's interactive tutorial

相關問題