Generic post
Non-technical team members like product owners and managers play a crucial role in software projects. However, they may not have the technical expertise to use Git effectively. Git aliases can simplify the process, enabling non-technical team members to easily make changes to the code and collaborate with technical team members.
For instance, suppose a product manager needs to modify the documentation of a public portal. Traditionally, she would need to clone the project, edit the content, and then use Git commands to push the changes. But this process can be complex and overwhelming for someone without a technical background. Instead, we can provide Git aliases to simplify the process. By using aliases, the product manager can push her changes with a single command without having to learn Git's abstractions.
Here are the commands required for the example:
- git clone <repository URL> - to clone the project from the repository to the local machine.
- Use an editor to make the necessary changes to the documentation.
- git add . - to add all the changes made to the documentation to the staging area.
- git commit -m "Commit message" - to commit the changes to the local repository with a descriptive commit message.
- git push - to push the changes to the remote repository on GitHub.
- Open a pull request on GitHub to merge the changes into the main branch of the project.
Since all changes are made within a single project, we can simplify the process even further by creating a single Git alias to handle all of the necessary commands.
- git clone <repository URL> - to clone the project from the repository to the local machine. This step would only need to be done once.
- Use an editor to make the necessary changes to the documentation.
- git myalias - To do steps 3, 4, 5, 6 all together.
operational
Before non-technical team members can contribute to a software project using Git, several preliminary tasks must be completed. These tasks are essential for creating a collaborative and streamlined development process. Here are the operational steps required:
- Install Git: The non-technical team member needs to install Git on their computer to interact with the project repository.
- Install Tooling: Depending on the project, there may be additional tools that need to be installed, such as Node.js or Python.
- Install a text editor: A text editor like Visual Studio Code or Sublime is required to make changes to the codebase.
- Configure a GitHub account: The non-technical team member needs a GitHub account to contribute to the project. The technical team members can assist with this step.
- Configure SSH keys: To securely interact with the GitHub repository, the non-technical team member needs to configure SSH keys. This is done by generating a public/private key pair and adding the public key to the GitHub account.
- Tutorial: Finally, the non-technical team member should be given a tutorial on how to use Git aliases to contribute to the project. This tutorial should cover the entire process, from making changes to pushing them to the repository.
By completing these operational steps, non-technical team members can easily contribute to a software project using Git aliases. This creates a more efficient and collaborative development process, empowering everyone on the team to contribute to the project's success.
uses cases
It's important to help non-software engineers contribute to a project not only with their first commit but also to maintain the project and fix mistakes. Here are some common situations:
Push a pull request
When you have your project up-to-date in a folder, you may want to make changes and open a pull request. One way to do this is by using a Git alias.
up = "!f() { git checkout -b \"$1\" 2> /dev/null && git checkout \"$1\" && git commit -am \"up commit\" && git push --set-upstream origin \"$1\" && open "https://www.github.com/ORG/foo-bar-baz/compare/master...\"$1\""; }; f"
So users just need to push the project “up” and give a name to the branch. Note this flow can be further simplified by using instead of .gitalias
the shell and a function for more capabilities.
Keep the project up-to-date
As the project evolves, non-technical team members may need to keep it up-to-date by making updates and changes to reflect product updates. However, caution is advised if changes have been made but not saved.
To keep the project up-to-date, non-technical team members can either update the project or push a change, but they should be aware that doing so will result in the loss of any unsaved work.
For simpler changes, a non-software engineer may find it easier to copy and paste the file they want to keep into another folder instead of dealing with the complexities of git merges or rebases.
down = "!f() { git checkout -force master; git reset --hard origin/master; git pull; }; f"
Fixing mistakes
For simple contributions, such as adding text to a file, a non-technical contributor's mistake can be easily fixed using a good text editor.
It's best to avoid tackling complex or difficult problems. Our focus is on simple documentation tasks. It doesn't make sense to try to modify multiple files or return to an intermediate state.
VSCode and similar editing tools have a view-to-view comparison of the changes that is easy to onboard.