Trong repo của tôi, tôi có một chi nhánh master
, và một chi nhánh new
.! [Từ chối] master -> tổng thể (phi nhanh về phía trước) trên một chi nhánh mới up-to-date
Tôi đã làm việc trên new
một thời gian, làm cam kết, và đẩy như tôi đi. Tôi đã quyết định chia nhỏ số new
và gọi số newest
. Vì vậy, tôi đã làm
git checkout -b "newest"
và chi nhánh đã được tạo thành công. Tôi đã thêm một tệp và bắt đầu làm việc trên đó. Tôi đã cam kết thay đổi của tôi một vài lần.
NHƯNG khi tôi cố gắng đẩy chi nhánh mới này và những thay đổi của tôi để nó để origin
, tôi nhận được lỗi này:
C:\wamp\www\myproj>git push origin
To https://github.com/Imray/Proj.git
! [rejected] master -> master (non-fast-forward)
! [rejected] new -> new (non-fast-forward)
error: failed to push some refs to 'https://github.com/Imray/Proj.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Vì vậy, theo quy định trong hướng dẫn, tôi đã cố gắng git pull
, nhưng sau đó tôi nhận:
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> newest
Tôi bị kẹt.
Làm thế nào để đẩy chi nhánh mới của tôi và những thay đổi để github
?