Git Core Processes

Git Processes


A gitignore file specifies intentionally untracked files that Git should ignore.1

Ignored files are usually build artifacts and machine generated files that can be derived from your repository source or should otherwise not be committed. Some common examples are (https://www.atlassian.com/git/tutorials/saving-changes/gitignore):

  • dependency caches, such as the contents of /node_modules or /packages
  • compiled code, such as .o, .pyc, and .class files
  • build output directories, such as /bin, /out, or /target
  • files generated at runtime, such as .log, .lock, or .tmp
  • hidden system files, such as .DS_Store or Thumbs.db
  • personal IDE config files, such as .idea/workspace.xml

The gitignore file is an essential part of a Git repository. Various files should not be deployed to a production environment or shared between development environments. "A gitignore file specifies intentionally untracked files that Git should ignore. Files already tracked by Git are not affected." (https://git-scm.com/docs/gitignore) There are standard templates for IDE's, such as JetBrains, VSCode, and Sublime, there are also templates for CMS/Frameworks, such as Django, Drupal, WordPress, and Larval. gitignore.io provides a command line interface to include various templates into a .gitignore file, https://docs.gitignore.io/install/command-line.

gitignore Command Line Tool

To run gitignore.io from your command line you need an active internet connection and an environment function. You need to add a function to your environment that lets you access the gitignore.io API.


gi list
gi linux,macos,windows,jetbrains,python >> .gitignore


A branch represents an independent line of development.2

Branching offers a way to work on a new feature without affecting the main codebase. You can create a branch from Bitbucket, Jira Software, or from your terminal. After you make changes, you push your branch to Bitbucket so that you can get it reviewed with a pull request. 3

List branches:

$ git branch -a

Create a branch to isolate feature or bug-fix

$ git checkout -b PRJ-123-awesome-feature develop

Branch Types

  • Feature branch - Used for specific feature work or improvements. Generally, branch from, and merge back into, the development branch using pull requests.
  • Bugfix branch - Typically used to fix Release branches.
  • Hotfix branch - Used to quickly fix a Production branch without interrupting changes in the development branch.

To keep your feature branch fresh and up to date with the latest changes in master

$ git fetch origin
$ git rebase origin/develop

Push branch remotely

$ git push -u origin PRJ-123-awesome-feature

Perform a final rebase cleanup after the pull request has been approved

$ git rebase -i origin/develop

Use the "ours" merge strategy to overwrite master with branchname

$ git checkout ''branchname''
$ git merge -s ours master
$ git checkout master
$ git merge ''branchname''


A tag is used to label and mark a specific commit in history.It is usually used to mark release points (e.g., v1.0, etc.).4

Although a tag may appear similar to a branch, a tag, however, does not change.It points directly to a specific commit in history.5

Git Basics - Tagging

Listing Your Tags

$ git tag

Annotated Tags

$ git tag -a v1.4 -m 'my version 1.4'

Lightweight Tags

$ git tag v1.4-lw

Checking out Tags

$ git checkout -b version2 v2.0.0

Last edited by MichaelAlber .
Page last modified on Saturday March 27, 2021 10:56:24 PDT.