Search code examples
gitgit-pushgit-pullgitkraken

GitKraken push and pull order for my situation


I pull a remote branch, which name is test, and GitKraken create a local branch which name is same as the "test" remote branch. While I'm merging some other branches into local "test", GitKraken showed up arrow beside my local "test" branch because now my local "test" is differ with remote "test". But there is also a down arrow showed up , which inform me that remote "test" got something new from the other developers .

My question is , at the time I saw both up and down arrow, should I pull first and push or just directly push is fine ?


Solution

  • If you would like to properly merge the changes made by the other developers with your changes, then you need to pull first. Git will then attempt to merge all the changes, and notify you to manually fix if there are any conflicts. The merge process creates a new merge commit, and then you can push the result to the remote.

    If you wish to overwrite the changes made by the other developers, you could do a force push, but this is generally a bad idea and should only be done if you're sure what you're doing.