2013-12-18 48 views
0

我可以成功地從其他計算機上提交上Github。Github - 無法同步此分支[包括日誌]

但是,它無法同步上傳的文件。我起訴Windows 8,並出現下圖。

enter image description here

所以,我進入外殼和類型的「混帳地位」及以下線路出現了。

C:\Users\Playmobs Jake\Documents\GitHub\bridge [master +47 ~68 -0 !]> g 
# On branch master 
# Your branch and 'origin/master' have diverged, 
# and have 1 and 4 different commits each, respectively. 
# (use "git pull" to merge the remote branch into yours) 
# 
# Changes not staged for commit: 
# (use "git add <file>..." to update what will be committed) 
# (use "git checkout -- <file>..." to discard changes in working dire 
# 
#  modified: .classpath 
#  modified: .project 
#  modified: AndroidManifest.xml 
#  modified: README.md 
#  modified: gen/com/playmobs/bridge/BuildConfig.java 
#  modified: gen/com/playmobs/bridge/R.java 
#  modified: gen/se/emilsjolander/stickylistheaders/R.java 
#  modified: proguard-project.txt 
#  modified: project.properties 
#  modified: res/drawable/bluetooth_selector.xml 
#  modified: res/drawable/border.xml 
#  modified: res/drawable/border_topdown.xml 
#  modified: res/drawable/dialog_selector.xml 
#  modified: res/drawable/endcall_selector.xml 
#  modified: res/drawable/friend_call_selector.xml 
#  modified: res/drawable/friend_dialog_call_selector1.xml 
#  modified: res/drawable/hide_selector.xml 
#  modified: res/drawable/keypad_selector.xml 
#  modified: res/drawable/listview_selector.xml 
#  modified: res/drawable/mute_selector.xml 
#  modified: res/drawable/profile_edit_selector.xml 
#  modified: res/drawable/round_shape.xml 
#  modified: res/drawable/scrollbar_vertical_thumb.xml 
#  modified: res/drawable/search_invite_selector.xml 
#  modified: res/drawable/sign_confirm.xml 
#  modified: res/drawable/sign_number.xml 
#  modified: res/drawable/speaker_selector.xml 
#  modified: res/layout/callscreen.xml 
#  modified: res/layout/fragment_friend.xml 
#  modified: res/layout/fragment_recent.xml 
#  modified: res/layout/fragment_search.xml 
#  modified: res/layout/fragment_setting.xml 
#  modified: res/layout/friend_dialog.xml 
#  modified: res/layout/friend_item_row.xml 
#  modified: res/layout/main.xml 
#  modified: res/layout/notice_item_row.xml 
#  modified: res/layout/option_dialog.xml 
#  modified: res/layout/profile_activity.xml 
#  modified: res/layout/recent_item_row.xml 
#  modified: res/layout/recent_list_header.xml 
#  modified: res/layout/ringscreen.xml 
#  modified: res/layout/search_item_row.xml 
#  modified: res/layout/signauth_activity.xml 
#  modified: res/layout/signup_activity.xml 
#  modified: res/layout/start_activity.xml 
#  modified: res/values-v11/styles.xml 
#  modified: res/values-v14/styles.xml 
#  modified: res/values/colors.xml 
#  modified: res/values/strings.xml 
#  modified: res/values/styles.xml 
#  modified: src/com/playmobs/bridge/call_activity.java 
#  modified: src/com/playmobs/bridge/main_activity.java 
#  modified: src/com/playmobs/bridge/phoneFunction.java 
#  modified: src/com/playmobs/bridge/profile_activity.java 
#  modified: src/com/playmobs/bridge/ring_activity.java 
#  modified: src/com/playmobs/bridge/signauth_activity.java 
#  modified: src/com/playmobs/bridge/signup_activity.java 
#  modified: src/com/playmobs/bridge/start_activity.java 
#  modified: src/com/playmobs/widget/ViewTimer.java 
#  modified: src/com/playmobs/widget/fragment_Friend.java 
#  modified: src/com/playmobs/widget/fragment_Recent.java 
#  modified: src/com/playmobs/widget/fragment_Search.java 
#  modified: src/com/playmobs/widget/fragment_Setting.java 
#  modified: src/com/playmobs/widget/friend.java 
#  modified: src/com/playmobs/widget/friendlist_Adapter.java 
#  modified: src/com/playmobs/widget/recentCallEntry.java 
#  modified: src/com/playmobs/widget/recentlist_Adapter.java 
#  modified: src/com/playmobs/widget/searchlist_Adapter.java 
# 
# Untracked files: 
# (use "git add <file>..." to include in what will be committed) 
# 
#  .settings/ 
#  bin/ 
#  lint.xml 
#  res/drawable-hdpi/Thumbs.db 
#  res/drawable-xhdpi/Thumbs.db 
#  res/drawable-xhdpi/bridge_logo.png 
#  res/drawable-xhdpi/dot_.png 
#  res/drawable-xhdpi/dot_selected.png 
#  res/drawable-xhdpi/dropout_chenk_btn.png 
#  res/drawable-xhdpi/dropout_chenk_btn_selected.png 
#  res/drawable-xhdpi/dropout_comfirm_red_btn.png 
#  res/drawable-xhdpi/friends_reset_btn.png 
#  res/drawable-xhdpi/friends_reset_btn_selected.png 
#  res/drawable-xhdpi/intro_logo.png 
#  res/drawable-xhdpi/intro_signin_btn.png 
#  res/drawable-xhdpi/intro_signin_btn_selected.png 
#  res/drawable-xhdpi/intro_signup_btn.png 
#  res/drawable-xhdpi/intro_signup_btn_selected.png 
#  res/drawable-xhdpi/manual_1_image.png 
#  res/drawable-xhdpi/manual_2_image.png 
#  res/drawable-xhdpi/manual_3_image.png 
#  res/drawable-xhdpi/playmobs_logo.png 
#  res/drawable-xhdpi/playmobs_logo2.png 
#  res/drawable/border2.xml 
#  res/drawable/drop_out.xml 
#  res/drawable/friends_sync.xml 
#  res/drawable/signin_selector.xml 
#  res/drawable/signup_selector.xml 
#  res/layout/announcement.xml 
#  res/layout/announcement_low.xml 
#  res/layout/change_picture.xml 
#  res/layout/company_introduction.xml 
#  res/layout/drop_out.xml 
#  res/layout/help.xml 
#  res/layout/help_low.xml 
#  res/layout/help_out.xml 
#  res/layout/intro.xml 
#  res/layout/intro_sub1.xml 
#  res/layout/intro_sub2.xml 
#  res/layout/intro_sub3.xml 
#  res/layout/intro_sub4.xml 
#  res/layout/splash.xml 
#  res/layout/sqlist_low.xml 
#  res/layout/sync_friends.xml 
#  src/com/bridge/ 
#  src/local/ 
#  src/org/ 
no changes added to commit (use "git add" and/or "git commit -a") 
C:\Users\Playmobs Jake\Documents\GitHub\bridge [master +47 ~68 -0 !]> 

你能看出什麼問題?

回答

1

這具有與git的保護您覆蓋數據每當你推/拉/從一個分支合併到另一個文件的方式有關。

在您的Windows 8計算機上,(本地)主分支上有4個新的提交。在遠程主分支,origin/master上,有一個新的提交等着你。

聽起來好像你試圖從origin/master拉到本地master,並且它未能同步來自origin/master的新提交,因爲它會覆蓋你的新提交(或者至少不知道如何將它們混合在一起)。

你有一些選擇這裏,但主要的想法是,你想從origin/master的修改合併到本地的主人,在這個過程中沒有丟失任何本地提交的。

您的兩個基本選項是rebase or merge。要從命令行執行此操作運行

git checkout [yourbranch] 
git pull --rebase origin master 

您也可以運行

git checkout [yourbranch] 
git merge origin/master 

這兩種方法的兩個分支應安全地混合,讓你推新提交回原籍/主。您應該收到有關如何排列提交的信息,並且您可以運行git log以確保一切正常。

如果有問題,使用git rebase --abort作廢衍合。如果您合併並想要返回,請運行git log並查找合併提交。然後在合併提交之前複製提交的長number號,然後運行git reset [commit sha]

,因爲你有你的本地主副本(或者被稱爲「骯髒的工作樹」)提交的修改,您可能會遇到問題。爲了避免這種情況發生,請提交您的更改,然後進行重定位/合併或未經承諾的更改以供以後使用。要存儲,請在終端中運行git stash命令,該命令將保存並隱藏所有未提交的更改,讓您安全地合併/重新綁定。運行git stash apply稍後會顯示您的隱藏更改,並且他們將返回就像他們在您粘貼git status輸出。