# Init a repo and add a remote
git init . git remote add origin https://sumuthwork.visualstudio.com/DefaultCollection/_git/Azure%20Gallery git push --set-upstream origin master
# Install from latest source
sudo apt-get update sudo apt-get install libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext wget https://github.com/git/git/archive/master.zip unzip master.zip cd git-master make prefix=/usr/local all sudo make prefix=/usr/local install
# Upgrade to a newer version
git clone https://github.com/git/git.git cd git make prefix=/usr/local all sudo make prefix=/usr/local install
# The first configuration after installation completes.
git config --global user.name "Jeffrey Fan" git config --global user.email email@domain.com
# Branch and merge
git checkout master git branch pxc-draft-3 mkdir pxc mv PXC-* pxc/ git add ... git commit ... git config --global push.default simple git push --set-upstream origin pxc-draft-3
# Rename local and remote branch
git branch -m pxc-with-haproxy-patch-1 pxc-draft-1 git push origin :pxc-with-haproxy-patch-1 git push origin pxc-draft-1
# Remove remote branch, and clean local obsolete tracking branches
git push origin :dev git fetch origin -p
转载于:https://www.cnblogs.com/jeffreyf/p/git.html