Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Culture of working together with git

183 views

Published on

We described some real world problems about git how it solve.

Published in: Technology
  • Be the first to comment

Culture of working together with git

  1. 1. Culture Of Working Together With GIT Next Step After Add, Commit, Push Ibrahim Gunduz ibrahimgunduz34@gmail.com https://twitter.com/ibrahimgunduz34 https://github.com/ibrahimgunduz34
  2. 2. Agenda ● GIT fundamentals ● What is the difference between merge and rebase ? ● When have we need to use merge or rebase ? ● What does it mean conflicts and how does it happen ? ● Let’s begin to try!
  3. 3. ● GIT works as distributed and doesn’t know any updates until you fetch changes from remote. So you must call git fetch command first to getting changes. GIT Fundamentals
  4. 4. GIT Fundamentals ● GIT doesn’t apply any changes to your code unless you merged changes with your branch. So you should apply merge methodology which is available for you. (merge or rebase)
  5. 5. GIT Fundamentals pull = fetch + merge pull --rebase = fetch + rebase
  6. 6. What Is The Difference Between Merge And Rebase ? Merge ● merge command, merges the specified branch via argumant with current branch as chronologically. (merge depending on the time)
  7. 7. What Is The Difference Between Merge And Rebase ? Rebase ● rebase command, apply changes after your merge base that came from base branch and put your changes to top of branch which is commit by yours after merge base of the current branch.
  8. 8. When Have We Need To Merge Or Rebase ? ● GIT compare your branches with remote by the commit sequence when you pushed to remote ● You mustnt’t run git pull command when you encountered the following message if you aren’t sure:
  9. 9. When Have We Need To Merge Or Rebase ? ● If you are working with your colleague in same branch: $ git pull --rebase origin YOUR_BRANCH_NAME ● If you want to recieve updates to your feature branch from master $ YOUR_BRANCH > git fetch upstream $ YOUR_BRANCH >git rebase upstream/master ● If you want to update your master branch (or stage, dev..) $ master > git pull upstream master
  10. 10. What does it mean conflicts and how does it happen ? ● Conflicts happen when any code bocks has two different revision while applying changes. ● <<<HEAD means head of the your local branch. ● Commit hash that came after equeal block is to be applied commit.
  11. 11. Let’s begin to try!

×