In Simply Git, we covered how to stage all the changes from the working to staging area. Let’s use our new bash function syntax to build an alias that stages all of the changes and then displays the status.
Labs
Labs are hands-on coding projects that you build along with Tonya as she explains the code, concepts, and thought processes behind it. You can use the labs to further your code knowledge or to use right in your projects. Each lab ties into the Docx to ensure you have the information you need.
Each lab is designed to further your understanding and mastery of code. You learn more about how to think about its construction, quality, maintainability, programmatic and logical thought, and problem-solving. While you may be building a specific thing, Tonya presents the why of it to make it adaptable far beyond that specific implementation, thereby giving you the means to make it your own, in any context.
Dealing with Merge Conflicts
Merge conflicts will happen. Let’s create one together. Then we’ll walk through how to find them and fix them.
Update Branch with Merge
In this episode, you and I will walk through the update workflow using the merge strategy. In order to do this, we’ll have to get creative in order to create a situation where the branch you are working on does not have the most recent updates that are in your develop branch. The workflow is: Checkout your develop branch. Pull the latest changes to update that branch. Checkout the change you are working on. Then do a git merge develop to update your branch. When this happens, git will create a “merge commit.” Here, let’s do it together.
Alias – Display the Last Commit’s Log
I often like to view the last commit’s log in order to remember what happened last. Let me show you how to view that log and then create an alias for it.
Alias – Add New Changes to Last Commit & Keep Message
In the Simply Git, you learned how to add new changes to your last commit. We can streamline that process to: Add all changes from both the working and staging areas. Keep the last commit message and not pop open the editor. Display the log when we’re done. Let’s build an alias.
Alias – Reword (Fix) Last Commit Message
In Simply Git, you learned how to fix the last commit message. Let’s build an alias.
Naming Branches
Let’s talk about naming strategies for your branches. Hint: Each team and/or project may have its own strategy for naming branches.
Alias – Display the Graphical Log
In the Git Contributing lab, I had you typing the really long command to view the one-line, decorated, graphical log. It’s one of my favorite commands as it gives you so much valuable information about your project’s history. Typing out that command is time consuming and frankly a waste of your valuable time. You have to try to remember all the options. That takes your focus off of where you add value. Let’s create an alias shortcut to make it so easy.
Alias – Unstage All Changes
In Simply Git, you learned how to unstage all of the changes, moving them from the staging to working area. The command and options are not intuitive, which means they are not rememberable. Let’s build an alias.
Lab Introduction
Let me introduce you to this lab.