Presentation is loading. Please wait.

Presentation is loading. Please wait.

Git Workflows.

Similar presentations


Presentation on theme: "Git Workflows."— Presentation transcript:

1 Git Workflows

2 The dos and don’ts

3 The dos Do read about Git Write useful, readable commit messages Set up your gitconfig Use topic branches locally Small, logical commits Do choose a workflow

4 The don’ts Don’t rebase public commits Don’t delete unmerged remote branches Don’t have more than 1 project per repo Don’t create a very large repo Don’t panic

5 Remotes

6 What is a remote? Remote repository You can have multiple remotes
9/19/2018 What is a remote? Remote repository Internet Network You can have multiple remotes Read-only Read/write Managing remotes Add Remove Branches © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

7 Why use remotes? Team collaboration Different workflows
9/19/2018 Why use remotes? Team collaboration No difference between a server and client Pull data from other devs Different workflows Might pull from multiple locations Push to integration repository © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

8 Showing Remotes $ git remote Shows remotes
9/19/2018 Showing Remotes $ git remote Shows remotes origin is the server you cloned from Use -v to see URLs © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

9 Adding Remotes $ git remote add [shortname] [url]
9/19/2018 Adding Remotes $ git remote add [shortname] [url] Shortname can be used as URL git remote add james A fetch can be run on the shortname git fetch james Branch would be [shortname]/[branchname] james/master © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

10 Fetching and Pulling $ git fetch [remote-name]
9/19/2018 Fetching and Pulling $ git fetch [remote-name] $ git pull [remote-name] Fetch Pulls data to local repo Doesn’t auto-merge Must manually merge Pull Does a fetch first Merges remote into current branch Similar to “get latest” © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

11 Pushing to Remotes $ git push [remote-name] [branch-name]
9/19/2018 Pushing to Remotes $ git push [remote-name] [branch-name] Push master branch to origin: git push origin master Push can be rejected Incorporate others’ work first © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

12 Remove and Rename Remotes
9/19/2018 Remove and Rename Remotes $ git remote rename [old] [new] $ git remote rm[shortname] Rename a remote git remote rename james jt Remove a remote git remote rm jt © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

13 Managing Remotes

14 Collaboration Workflows

15 Centralized Workflow Shared Repository Developer Developer Developer

16 Integration-Manager Workflow
Blessed Repository Developer Public Developer Public Developer Public Integration Manager Developer Private Developer Private Developer Private

17 Dictator and Lieutenants Workflow
Blessed Repository Dictator Lieutenant Lieutenant Developer Public Developer Public Developer Public

18 Contribution Workflows

19 Topic branches Branch per feature/bug Push branch to blessed repo Merge, or rebase, onto master

20 Centralized Private branches Fetch Rebase/merge onto master Push

21 Workflows

22 Questions?


Download ppt "Git Workflows."

Similar presentations


Ads by Google