在Mac上使用GitHub应用程序(不是cli),我有这个错误,我不太懂,也不知道如何修复。我知道这是一个错误,因为应用程序会抛出一个显示“GitHub Error”的窗口。我需要将更改提交到下面列出的文件,但GitHub不会让我。当我按下提交按钮时,出现错误,似乎我无法做任何事情来解决它。任何帮助都会很棒。
# On branch master
# Your branch is ahead of 'origin/master' by 2 commits.
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: .gitignore
# modified: haystack.egg-info/SOURCES.txt
# modified: haystack/__init__.py
# modified: haystack/search.py
# modified: haystack/static/css/layout.css
# modified: haystack/static/images/classifications/G.png
# modified: haystack/static/images/classifications/M.png
# modified: haystack/static/images/classifications/MA.png
# modified: haystack/static/images/classifications/PG.png
# modified: haystack/static/images/classifications/R.png
# modified: haystack/static/images/classifications/X.png
# modified: haystack/templates/base.jinja2
# modified: haystack/templates/base_page.jinja2
# modified: haystack/templates/search.jinja2
# modified: haystack/templates/search_results_episodes.jinja2
# modified: haystack/templates/view_episode.jinja2
# modified: haystack/templates/view_program.jinja2
# modified: haystack/view.py
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# haystack/static/images/classifications/G.pxm
# haystack/static/images/classifications/M.pxm
# haystack/static/images/classifications/MA.pxm
# haystack/static/images/classifications/NA.png
# haystack/static/images/classifications/PG.pxm
# haystack/static/images/classifications/R.pxm
# haystack/static/images/classifications/X.pxm
# haystack/static/images/haystack_logo.png
# haystack/static/images/test_key_art.jpg
# haystack/static/images/test_thumbnail.jpg
# haystack/templates/view_asset.jinja2
# haystack/templates/view_assets.jinja2
no changes added to commit (use "git add" and/or "git commit -a")
(256)
答案 0 :(得分:4)
通过此消息,git
告诉您本地提交树在github.com上位于回购之前。
Repo in github Your local
Y <-+
| | ahead of 2 commits
Z <-+
|
commit A <----------------> A
| \ | \
B D B D
| / | /
C C
| |
似乎这是git status
的输出。您只需git add
对stage area
进行更改,然后使用git commit -m "your message"
将此代码提交到本地存储库。
如果您想将工作重新置于github.com
,请使用git push
。
答案 1 :(得分:0)
如果要放弃对本地主分支的更改并从远程(github)拉主机,请执行以下操作: