Skip to content

Instantly share code, notes, and snippets.

@userddssilva
Last active February 17, 2024 21:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save userddssilva/83a66d65cf062968d3a1d10bf316cd75 to your computer and use it in GitHub Desktop.
Save userddssilva/83a66d65cf062968d3a1d10bf316cd75 to your computer and use it in GitHub Desktop.
Git notes to remember

Git Cheat Sheets

Git commands

  • Create and a local branch from origin
git branch -t origin/branch-name
  • Create and swap the branch
git checkout -t origin/branch-name
  • Unversione directory
  1. Add the folder path to your repo's root .gitignore file.

  2. Remove the folder from your local git tracking, but keep it on your disk.

git rm -r --cached path_to_your_folder/
  1. Push your changes to your git repo.

The folder will be considered "deleted" from Git's point of view (i.e. they are in past history, but not in the latest commit, and people pulling from this repo will get the files removed from their trees), but stay on your working directory because you've used --cached.

Git commits messagens

Ref: Medium artigo

O type é responsável por nos dizer qual o tipo de alteração ou iteração está sendo feita, das regras da convenção, temos os seguintes tipos:

Type Description Example
test Any creation or modification of test code. Unit test creation.
feat Development of a new feature. Added a new service, functionality, or endpoint.
refactor Code refactoring without impacting core logic. Code changes after a code review.
style Formatting and style changes without altering functionality. Updated style guide, changed linting conventions, fixed indentation, removed whitespace, removed comments.
fix Bug fixes and error corrections. Applied fix to a function behaving unexpectedly and returning an error.
chore Development-related changes not affecting the system or tests. Changed eslint rules, added prettier, updated .gitignore file.
docs Documentation changes. Added information to API documentation, updated README.
build Changes affecting the build process or external dependencies. Updated Gulp tasks, added/removed npm dependencies.
perf Performance improvements. Replaced ForEach with while loop, optimized database query.
ci Changes to CI configuration files. Updated CircleCI, Travis, or BrowserStack configuration.
revert Reversion of a previous commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment