Skip to content

git config - a team collaboration setup #9

@lakruzz

Description

@lakruzz

Aliases

  • Where would you put a .gitconfig file that should contain aliases and settings to be shared among team members?
  • How would you include the file?
  • How would you instruct new team members to include the file?
  • Go through your three config files and move anything worth sharing into you new file.
  • Is there anything left in your --global file?
  • What command would you use to get a quick overview of all your aliases - and the scope that they come from?
  • Add, commit and push your changes

One specific feature that git users seek to get out of the git config files are aliases. Often short-hand favourites to (too) long commands like:

co = checkout
st = status

Or it can be home-made names for long-and-hard-to-remember commands like my:

root = rev-parse --show-toplevel

You define them as entries under the alias group:

Try this:

git co
git st
git root
git config --global  --add alias.co checkout
git config --global  --add alias.st status
git config --global  --add alias.root "rev-parse --show-toplevel"
git co
git st
git root

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions