git不能提交给github

时间:2016-08-24 03:43:57

标签: git github

$ git --version   # my git version
git version 2.7.4

$ ls  # three directories
Nim_Game Reverse_String  Sum_of_Two_Integers

$ git status
HEAD detached from origin/master
nothing to commit, working directory clean

$ git log --oneline --decorate --graph --all    # part info of commits
* dad1c24 (HEAD) add Sum_of_Two_Integers
* a7c4e04 (origin/master, origin/HEAD, master) delete
* 50d07fe delete
* 1323f39 delete
* 78a7dda modify file name
* 60f58a5 Nim_Game
* 456dfe3 add Reverse_String.java

我已经将Sum_of_Two_Integers提交给本地回购,但我无法将其推送到github。我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

您现在可以转移到新的临时分支,稍后将其集成到主分区。

git commit -m "Suitble Message"
git branch new-temp-branch
git checkout master
git merge new-temp-branch