GIT Commands

Clone a branch

git clone

Display the current local branches and the head you are on

git branch


git checkout cool-branch-name    ~ Switch to another branch
git checkout -- * ~ Clear tracked modified files not committed
git checkout [revision] ~ Fall back to revision (run 'git log' to see commits)

Remote repository

git pull                         ~ Get anything new from remote server
git push ~ Push staged and committed to remote


git clean -d --dry-run           ~ Purge untracked files/dirs
git clean -d -f ~ -f is required if clean.requireForce is not set to false

Show local changes

git status

Add anything new

git add .

Commit locally, view diff

git diff
git commit -m "commit message"

Delete branch

git push -d origin [BRANCH NAME]

Update to self signed certificate

git config --global http.sslCAinfo "c:/data/certs/certname.crt"

--back to default if the above plows
git config --global http.sslCAInfo "C:\Program Files\Git\etc\pki\ca-trust\extracted\openssl\"



Leave a Reply