wiki
Getting startedGuidesFAQ
1.0.0
1.0.0
  • b-it-bots wiki
  • @home
    • Getting started
      • First steps
      • Setting up your development environment
        • Configuring your editor
        • Using ssh
      • Adding your first contribution
    • Tutorials
      • Architecture
    • Guides
      • git
        • Making good commits
        • Branching model
        • Adding git aliases to make your life easier
        • Creating a release
      • SSH
      • ROS
        • Creating a new package
          • Creating a new node
        • Creating a new message, service or action
        • Testing in ROS
        • Linting
      • Coding conventions
        • C++
        • Python
      • Toolkit
        • CLion
        • Atom configuration
        • Using vim
        • TMUX - Terminal Multiplexer
    • Resources
    • FAQ
      • git
  • @work
    • 2018-05-06-navigation-atwork
    • 2018-05-06-simulation_mapping
    • How to use the RealSense2 camera
    • Getting the classifier from a data set
Powered by GitBook
On this page
  • Installation
  • Usage
  • Lists
  • Checking commit history
  • Doing some work
  • Undoing some work
  • Contributors
  • See Also

Was this helpful?

  1. @home
  2. Guides
  3. git

Adding git aliases to make your life easier

PreviousBranching modelNextCreating a release

Last updated 4 years ago

Was this helpful?

Installation

The .gitconfig file in the b-it-bots/dev-env repository contains some useful aliases to use with git.

You can copy the contents of to the global ~/.gitconfig in your laptop if you want to use them in all your repositories (recommended).

If you only want to use them in the MAS repositories, copy them to the .git/config wherever you cloned one of the mas_* repositories.

Usage

You can use git aliases like this:

git <alias>

Lists

  • branches - List all your branches

  • tags - List all your tags

  • stashes - List all your stashes

  • remotes - List all your remotes

  • aliases - Shows a list of your existing aliases

Checking commit history

  • last - Show your last commit

  • graph - A graph version of who the commit history

  • prettylog - Show a pretty log of the commit history

  • history - Show the last 10 commits in a one line pretty format

  • scrum - Show the commits made by you in the last day (Note: you need to change your name when you copy this alias)

Doing some work

  • precommit -

  • unmerged -

  • summary - Show the status of files in a short format, including untracked files

  • unstash <stash index> - To apply the stashed changes to your current workspace

  • squash <number of commits> - Combine several commits into one

  • branchdiff - Like git diff but for branches

Undoing some work

  • unstage - Unstage all files that are currently added but have not yet been commited.

  • discard - Discarding changes in file(s)

  • uncommit - Revert your last commit

  • amend - Ammend (fix) your last commit message

  • nevermind - CAUTION: Discard all the changes on your local directory

Contributors

  • Argentina Ortega - Original author

See Also

the .gitconfig file
Git Basic Aliases
Git Aliases
Human Git Aliases