2016-09-07 54 views
0

我想从我的本地系统上传我的bitbucket存储库中的所有修改。 过程上传对到位桶仓库git pull起源问题<branch name>

git branch 
git branch -a 
git checkout <branch_name> 
git add . 
git commit -m "message" 
git push origin <branch_name> 
git status 

我上面过程中完成对到位桶库上传代码,所有修改过的文件和代码特别分支成功上传的所有代码。 但是,当从在服务器中的特定分支取出库然后某些文件被取出和一些文件被错过(I使用下面proceess取出来自到位桶库代码)

login in my server and go to project folder 
git pull origin <branch_name> 
then I got the following error => Error in app/controllers/index_controller.rb 
app/models/index.rb 
app/views/index.html.erb 
db/schema.rb 
and so on 

然后我按照这些命令

git stash save --keep-index 
git stash drop 
git reset file_path(app/controllers/index_controller.rb) 
git pull origin +branch_name 
sudo service apache2 restart 

我遵循上述所有过程,但我从bitbucket存储库中提取了一些文件,并丢失了一些文件。 所以请帮助我,我试着6〜8次,但我得到了同样的问题,我在哪儿错的,什么是错误

回答

0

取决于你是在哪个分支。首先尝试

git fetch --all 

上面会列出所有分支,然后结帐在所需的分支,从那里拉正常。

请记住始终确保拉/推是在同一分支上完成的,即。如果您在本地回购的主分支中,则将其推入到bitbucket的主分支中。如果你相信,最新的代码是到位桶,你可以尝试 混帐拉-f起源

(-f是从力量到到位桶地方去取)

+0

我试过“混帐取--all”命令,然后我得到了错误:你的意思是'--all'(有两个破折号?) –

+0

我也尝试过“git pull -f origin”,然后我得到以下消息(没有合适的参与者之间的合并 通常这意味着你提供了一个通配符refspec,它在远端没有 匹配。) –

+0

是有两个破折号,提取 - 所有的远程列表吗? – iSensical

相关问题