您的位置:首页 > 其它

Git

2015-08-03 22:08 246 查看
# 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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: