- commit the changes to local repository (need to add new files explicitly)
- push the commit to remote repository
Here are some commands I would like to share:
Create a new local branch from an existing branch and switch to the new branch:
git checkout -b new_branch existing_branchPush a newly created branch
git push -u origin new_branch_name-u will make your branch tracked
Push a tag
git push origin tag_name
Push all tags not in remote server
git push origin --tags
Delete a local branch
git branch -D branch_nameDelete a remote branch
git push origin :remote_branch_nameDelete a local tag
git tag -d tag_nameDelete a remote tag
git push origin :refs/tags/tag_nameRemove the references to the deleted remote branches
git remote prune originDelete last commit (not pushed yet)
git reset --hard HEAD~1List all key/value pairs for git config
git config -lGet a value for a key in git config (for example, get git repository url):
git config --get remote.origin.urlShow all file names changed in a single commit:
git show --pretty="format:" --name-only commit_hashCherry Pick
git cherry-pick commit-id-from-other-branch
No comments:
Post a Comment