Git push heroku-staging staging:master (localBranchName:remoteBranchName) Git push heroku yourbranch:master simple form Push local branch to differently named remote branch. Git remote show origin show localremote branch tracking and sync status (duplicate info under "remote repositories") Git remote prune origin clean up deleted remote branches (let's say someone else deleted a branch on the remote) Git push origin :branchname delete remote branch 'branchname' Git fetch origin``git branch -r list remote branches (after a fetch) Git checkout master git merge branchname conditions for fast-forward merge - nothing new on master between branch start/end points Git checkout -b branchname create and checkout new branch in one go Git checkout branchname move to that branch Git branch list currently existing branches Git diff HEAD.origin/master shows all changes on remote compared to local HEAD Git log HEAD.origin/master -oneline shows commit messages Git show remote origin show localremote branch tracking and sync statusĮxamine changes on remote, without pulling them Git show-branch *master will show you the commits in all of the branches whose names end in master (eg master and origin/master). If it says nothing, the local and remote are the same. Git status -uno will tell you whether the branch you are tracking is ahead, behind or has diverged. Git remote -v update bring remote refs up to date (and -v show which branches were updated) Git fetch origin update the local cache of the remote repository Git pull checkout and merge remote changes in one go Git remote -v show show the available remote repositories that have been added Git push -u origin master push current local repo to remote. Git remote add origin a remote repository the \ in ^ is just an escape char to make zsh play nice and is not necessary if using bash. Git rebase -onto \^ HEAD remove specific commit from repository. Git checkout - cats.html index.html Undo all changes that were made to files cats.html and index.html Git reset -hard HEAD^^ Undo two (^^) last commits and all changes Git reset -hard HEAD^ Undo last commit and all changes Git reset -soft HEAD^ undo previous commit, put changes in staging Git commit -amend -m 'message' alter the last commit (add any staged files, new comment) Git commit -am 'message' add/commit all changes from all tracked files (no untracked files) in one go Git diff list (unstaged) changes to files Git status list which (unstaged) files have changed This is a list of the commands I use most frequently, listed by functional category: The git command-line utility has plenty of inconsistencies Ī GUI like is often helpful, but staying on the command line usually quicker.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |