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 fetch origin update the local cache of the remote repository Git pull checkout and merge remote changes in one go Git remote -v update bring remote refs up to date (and -v show which branches were updated) Git remote show origin show localremote branch tracking and sync status 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 add 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 Undoing previous actions Git log list recent commits Adding files to repo 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: Current state 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. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |