All our projects use Git and most of them are hosted on Github. Here we will discuss some defaults that we use.
We never touch the
main branch especially if the project is live. During development you can either have a
dev branch or feature branches. Every feature is merged into the project through a
Pull Request and then the branch is deleted.
The repo name should always be lowercase and if it contains more words it should be kebab-cased. Here are some examples:
During development we usually use two branches:
dev. Once the project is live we no longer use the
dev branch and stick to feature branch names.
For feature branches we don't use strict naming conventions. As long as the name describes the feature you are working on its fine. Make sure to only contain lowercase letters and hyphens.
feature-develop, definitely no
During your work on a
feature or a
dev branch you will usually have to commit code. During development we don't follow any strict naming conventions but a descriptive commit is required.
fixed responsive issue on header,
updated contact section
After a feature has been completed its a good idea to make a pull request so another team member can review the work you have done. We don't follow any strict code review policies, but its always a good idea to have a peer to review the code. Here are some rules to follow:
- The name of the Pull Request reflects the work you have done.
- A clear description on the work you have done.
- Optionally a question to ask a team member so he can review something.
git initgit add . && git commit -m "Initial commit"## if your default is master, switch to main.git branch -M maingit remote add origin https://github.com/lucky-media/repo-name.gitgit push -u origin main
git switch -c branch-name
# clone the repogit clone firstname.lastname@example.org:USERNAME/REPOSITORY.gitcd REPOSITORY# remove all history locallyrm -rf .git# create a new local repogit init# add everythinggit add .git commit -m "First commit"# nuke history on GitHub (irreversable)git remote add origin email@example.com:USERNAME/REPOSITORY.gitgit push -u --force origin main