Git-常用命令
技术11 年前
develop via a single branch
bash
t branch -m {{branch}}
git fetch origin
git rebase origin/master -i
git push origin {{branch}}create a new branch
bash
git checkout -b {{branch}}checkout remote branch
bash
git checkout -b {{branch}} origin/{{branch}}merge branch to master
bash
git checkout master
git merge {{branch}}delete branch
bash
git branch -D {{localBranch}}
git push --delete origin {{remoteBranch}}rename repo
bash
git remote -v
// View existing remotes
// origin https://github.com/user/repo.git (fetch)
// origin https://github.com/user/repo.git (push)
git remote set-url origin https://github.com/user/repo2.git
// Change the 'origin' remote's URLadd tag
bash
git tag {{tag}}
git push --tagsadd tag for a history commit
bash
// Set the HEAD to the old commit that we want to tag
git checkout {{leading 7 chars of commit}}
// temporarily set the date to the date of the HEAD commit, and add the tag
GIT_COMMITTER_DATE="$(git show --format=%aD | head -1)" git tag -a {{tag}} -m "{{commit message}}"
// set HEAD back to whatever you want it to be
git checkout master
git push --tagsdelete tag
bash
git tag --delete {{tag}}
git push --delete origin {{tag}}gh-pages
bash
http://{{group}}.github.io/{{repo}}/npm add owner
bash
npm owner add {{name}}