4
minnymouse@XXXXXXX  /c/XXXXXXXXX/XXXXXXXXX/XXXXXXXXX (development)
$ git status
On branch development
Your branch is ahead of 'origin/development' by 2 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

minnymouse@XXXXXXX /c/XXXXXXXXX/XXXXXXXXX/XXXXXXXXX (development)
$ git push origin development
To ssh://xxxxxx/xxx/xxxxx/git/repos/xxxxx
 ! [rejected]        development -> development (fetch first)
error: failed to push some refs to 'ssh://xxxxxx/xxx/xxxxx/git/repos/xxxxx'
hint: Updates were rejected because the remote contains work that you do not
hint: have locally. This is usually caused by another repository pushing to
hint: the same ref. If you want to integrate the remote changes, use
hint: 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

minnymouse@XXXXXXX /c/XXXXXXXXX/XXXXXXXXX/XXXXXXXXX (development)
$ git pull
remote: Counting objects: 10, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 10 (delta 5), reused 0 (delta 0)
Unpacking objects: 100% (10/10), 1.06 KiB | 43.00 KiB/s, done.
From ssh://xxxxxx/xxx/xxxxx/git/repos/xxxxx
   7948726..7dc3f5c  development     -> origin/development
   b9042ed..d04db55  feature/luxor   -> origin/feature/luxor
   7948726..7dc3f5c  production      -> origin/production
hint: Waiting for your editor to close the file...

If I close the editor without a comment, does it abort the pull completely? If not, what does the message in the editor file mean:

# Lines starting with '#' will be ignored, and an empty message aborts the commit.

Is all of this going to be integrated into my local copy of development? If not, what's the purpose of this?

7948726..7dc3f5c  development     -> origin/development
b9042ed..d04db55  feature/luxor   -> origin/feature/luxor
7948726..7dc3f5c  production      -> origin/production
Giacomo1968
  • 58,727
yaris
  • 43

1 Answers1

6

It will not abort the pull if you close your editor. You will still be in a merge state when you open it again.

What is happening here is you're trying to push code to the development remote branch. However, it recognizes that you are not up to date with what is currently in development. Therefore it is rejecting your push, and telling you to first pull down the current state of development so git can determine if there are any merge conflicts that you need to resolve before you can push.

In this case, you did not have any merge conflicts. When the prompt # Lines starting with '#' will be ignored, and an empty message aborts the commit. came up, that is vi or vim requesting you to interact. If it was already in type mode, you just need to type :wq and hit enter. Then you could push again.

If it is not in type mode, you would need to press i, then type a merge message if you want, then esc, and type :wq and hit enter

Ultimately, it seems like you're wanting your own local branch that you can push to and then later on merge it to development, ideally with a pull request.

To start your own new local branch off of development, you would want to be on development, make sure you have the most recent copy by doing git pull and then do git checkout -b branchName ex: git checkout -b my-new-branch

DrZoo
  • 11,391