feat: a commit of the type feat introduces a new feature to the codebase (this correlates with MINOR in Semantic Versioning).fix: a commit of the type fix patches a bug in your codebase (this correlates with PATCH in Semantic Versioning).Triggering build and publish processes.Communicating the nature of changes to teammates, the public, and other stakeholders.Automatically determining a semantic version bump (based on the types of commits landed).Use Conventional Commits specification for adding human and machine readable meaning to commit messages. Option B: Fork from the main repo -> do your thing -> send PR.Option A: Clone main repo -> create a new branch -> do your thing -> send PR to main branch. ![]() Happens often during pull/ push or merging a PR. Merge conflict - when you make changes to a file and someone else make some other changes to the same file and along the same line numbers you get merge conflict. To push commits to remote main branch: git push origin main To push commits to your remote branch: git push Push - means uploading your local commits to a remote server. To pull from remote main branch: git pull origin mainĬommit - means adding a record entry of your changes e.g. To pull from your remote branch: git pull Pull - means getting latest changes from a remote branch into your branch ( git pull = git fetch + git merge) git merge is required to integrate these changes ![]() HEAD - head always refers to the latest commit on your current branch.įetch - just download latest changes from a remote branch in separate path and do not integrate with your repo. Main - it's the head branch named main (default created branch for any new repo, earlier it was used to be master) Tag - you can create a tag when doing software releases Upstream - upstream is their main repo (from which you have forked, useful to get latest changes from their repo releases) Origin - origin is your remote repo (from where you did git clone) Remote repository - your git repo stored on github, bitbucket, etc. Remote - remote means server like github, bitbucket, etc. So, I decided to write these down in one place as a handy cheatsheet so that it's easier for me (and hopefully others) to recall and use. Situations like how to pull changes without committing local files, save uncommitted changes in the current branch and switch, add new changes to the last commit, reset my local branch to main, revert the latest commit from local and remote, etc. When I collaborate with others using Git, I often have to google to find the right git commands for various situations. Clean up a fork and restart it from the upstream.Revert all local changes and local commits (local).Revert last remote commit (remote, untraceable). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |