Giter VIP home page Giter VIP logo

git-commit-amend-test's Introduction

repository에 push한 상태에서 5가지 경우로 나누어서 테스트

참여하는 contributor

1. desktop
2. notebook

주의

밑의 상황은 desktop과 notebook에서 remote repository를 최신으로 업데이트 갱신해놓은 상태에서 진행함.


5가지 상황

  1. desktop에서 push하고, notebook에서 pull하지 않은 상태에서 desktop에서 --amend로 커밋 메시지 수정 후에 git push 해보고 안 되면 git push --force-with-lease

  2. desktop에서 push한 것을, notebook에서 pull한 상태에서 notebook에서 작업을 하지 않고 desktop에서만 --amend로 커밋 메시지 수정 후에 git push, git push --force-with-lease

  3. desktop에서 push한 것을, notebook에서 pull한 상태에서 notebook에서 작업을 진행한 후, desktop에서만 --amend로 커밋 메시지 수정 후에 git push, git push --force-with-lease

  4. desktop에서 push한 것을, notebook에서 pull한 상태에서 notebook에서 작업을 진행한 후, push하고 desktop에서 pull하지 않고 --amend로 커밋 메시지 수정 후에 git push, git push --force-with-lease

  5. desktop에서 push한 것을, notebook에서 pull한 상태에서 notebook에서 작업을 진행한 후, push하고 desktop에서 pull하고 --amend로 커밋 메시지 수정 후에 git push, git push --force-with-lease

1번 후에 2번에서 notebook에서 pull하는 것으로 정상적으로 되는지 확인할 수 있을 듯.

예상

  1. notebook에서 pull하지 않았는데 push 혹은 push -f를 하는 것이므로 정상적으로 pull도 되고 이후에 작업을 하더라도 연동된 것으로 하기 때문에 삭제된 커밋이 되살아나거나 하는 일은 없을듯.

  2. 작업은 하지 않았으므로 1번처럼 될듯.

  3. 3번이 끝난 뒤에 notebook에서 pull한다고 할 때, 병합 과정에서 충돌이 없다고 가정할 때는 정상적으로 병합되고 notebook 측의 working directory와 stage도 문제 없이 유지될 것으로 보임.

  4. 문제가 발생할 것 같은 부분. notebook에서 push한 내용을 desktop에서 덮어쓰기 때문에 기존의 push된 commit이 유실될 뿐만 아니라 pull하더라도 문제가 생길 수 있을 것 같음.(notebook의 head가 remote repository의 head보다 앞서있는 A/HEAD 상태일 것.)

  5. 기본적으로 desktop에서 pull하면 notebook에서 pull하지 않았기 때문에 서로 최신 상태라 push를 해도 문제가 없을 것으로 보인다.

고로 결론은, 서로 최신 상태가 아닌데 한 쪽이 git push --force를 하게 되면 문제가 생길 것으로 예상한다.

git-commit-amend-test's People

Contributors

shangbinlee avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.