Skip to content

Setting Up Git Configurations

Manually

  1. Set your username:

    sh
    git config --global user.name "kellydc"
  2. Set your email:

    sh
    git config --global user.email "kelly.carinola@gmail.com"
  3. Set your default text editor:

    sh
    git config --global core.editor "code"
  4. Set up aliases (optional):

    sh
    git config --global alias.co checkout
    git config --global alias.br branch
    git config --global alias.ci commit
    git config --global alias.st status
  5. View your configurations:

    sh
    git config --list

Using Dotfiles

  1. Create a .gitconfig file in your home directory:

    sh
    touch ~/.gitconfig
  2. Add your configurations to the .gitconfig file:

    ini
    [user]
        name = Your Name
        email = your.email@example.com
    [core]
        editor = your_editor
    [alias]
        co = checkout
        br = branch
        ci = commit
        st = status
  3. Link your dotfiles repository (if you have one):

    sh
    ln -s /path/to/your/dotfiles/.gitconfig ~/.gitconfig
  4. Verify your configurations:

    sh
    git config --list
  5. Update local before you checkout a branch

    sh
    git fetch origin
    git checkout docs/Initial
  6. Create a new branch:

    sh
    git checkout -b docs/Initial
  7. Commit your changes:

    sh
    git commit -am "Add Git configurations"
  8. Push your changes to the remote repository:

    sh
    git push origin docs/Initial
  9. Create a pull request on GitHub:

    sh
    gh pr create --base main --head docs/Initial -f -r techmimer
  10. Merge the pull request on GitHub:

    sh
    gh pr merge docs/Initial
  11. Delete the branch locally:

    sh
    git branch -d docs/Initial
  12. Delete the branch remotely:

    sh
    git push origin --delete docs/Initial
  13. Update your local repository:

    sh
    git pull origin main
  14. Delete the branch locally:

    sh
    git branch -d docs/Initial
  15. Create a tag

    sh
    git tag -a v1.0 -m "Initial release"
  16. Push the tag

    sh
    git push origin v1.0

By following these steps, you can set up your Git configurations either manually or by using dotfiles.