mobilege / Git Documentation tldr
- https://docs.gitlab.com/ee/topics/git/
- https://www.atlassian.com/git/tutorials
- https://github.com/git-guides
/usr/bin/gitis the path to the system-provided Git executable.- Apple actually maintain and ship their own fork of Git. source
/usr/local/bin/gitsymbolic link to the Git executable when installed via Homebrew- points to
/usr/local/Cellar/git/2.34.1/bin/git
- points to
$ git branch testing # Create a new local branch
$ git checkout testing # Switch to an existing local branch
$ git checkout -b iss53 # Create a new local branch & switch to it (in one step)https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging
$ git push <remote> <local branch>:<remote branch>
$ git push origin serverfix # if the local & remote branches have the same name
$ git push # pushes current branch, if tracking set up
$ git push --all # pushes all brancheshttps://git-scm.com/book/en/v2/Git-Branching-Remote-Branches
$ git checkout -b <branch> <remote>/<branch>
$ git checkout --track origin/serverfix
$ git checkout serverfix
# Branch serverfix set up to track remote branch serverfix from origin.
# Switched to a new branch 'serverfix'https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches > 'Tracking Branches'
- deletes refs to branches that don't exist on the remote
$ git remote set-url origin git@<host>:rabin-joshi-cognizant/cognizant-enablement.git
# <host> should match the host alias defined in ~/.ssh/config$ git config user.name "rabin-joshi-cognizant" # updates local
$ git config user.email "rabin.joshi@cognizant.com" # updates local
$ git config -l # shows all: system, global and local$ code ~/.ssh/config # opens the file in VS Code