User Tools

Site Tools


newdevs:git:commands

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
newdevs:git:commands [2020/10/07 17:32] – [Squash Commits] tmccannanewdevs:git:commands [2020/10/20 15:58] – [Git Commands] tmccanna
Line 29: Line 29:
   * ''git config <nowiki>--global</nowiki> -l'' --> list all global configuration values   * ''git config <nowiki>--global</nowiki> -l'' --> list all global configuration values
   * ''git config <nowiki>--global</nowiki> keyname "value"'' --> create a global value   * ''git config <nowiki>--global</nowiki> keyname "value"'' --> create a global value
-  * ''git fetch <nowiki>--all</nowiki>'' --> refresh your local cache from the remote branches (does not download new branches) +  * ''git fetch <nowiki>--all</nowiki>'' --> refresh your local cache from the remote branches (does not download new branches); equivalent to git remote update 
-  * ''git help'' --> access the built-in Git help documentation.+  * ''git fetch working'' --> fetches all new branches in the working directory 
 +  * ''git help'' --> access the built-in Git help documentation
   * ''git log <nowiki>--oneline</nowiki>'' --> list previous commits with their unique ids   * ''git log <nowiki>--oneline</nowiki>'' --> list previous commits with their unique ids
-  * ''git pull'' --> imports all updates from your default remote repo to your default local repo (usually, this is equivalent to 'git pull origin master')+  * ''git pull'' --> imports all updates from your default remote repo to your default local repo (usually, this is equivalent to 'git pull origin master'); pull is equivalent to doing a fetch followed by a merge
   * ''git pull origin master'' --> import all updates from remote origin repo to local master repo   * ''git pull origin master'' --> import all updates from remote origin repo to local master repo
   * ''git pull <nowiki>--rebase</nowiki> origin master'' --> rebases (rather than merges) new remote changes to your local repository   * ''git pull <nowiki>--rebase</nowiki> origin master'' --> rebases (rather than merges) new remote changes to your local repository
Line 38: Line 39:
   * ''git push working <nowiki>--delete</nowiki> mybranchname'' --> delete a remote branch   * ''git push working <nowiki>--delete</nowiki> mybranchname'' --> delete a remote branch
   * ''git remote -v'' --> display remote directories   * ''git remote -v'' --> display remote directories
 +  * ''git remote update'' --> 
   * ''git reset HEAD myfile.txt'' --> unstage a file that has already been staged   * ''git reset HEAD myfile.txt'' --> unstage a file that has already been staged
   * ''git reset <nowiki>--hard</nowiki>'' --> reset a current branch to its original state   * ''git reset <nowiki>--hard</nowiki>'' --> reset a current branch to its original state
Line 43: Line 45:
   * ''git reset <nowiki>--hard HEAD^</nowiki>'' --> remove last commit   * ''git reset <nowiki>--hard HEAD^</nowiki>'' --> remove last commit
   * ''git rm badfile.txt'' --> delete a file (if the file is being tracked, be sure to add a commit message indicating the file has been deleted)   * ''git rm badfile.txt'' --> delete a file (if the file is being tracked, be sure to add a commit message indicating the file has been deleted)
 +  * ''git show <hash>'' --> display the commit text and differences
   * ''git show <nowiki>--stat</nowiki>'' --> see what your commit will look like before you push it   * ''git show <nowiki>--stat</nowiki>'' --> see what your commit will look like before you push it
   * ''git status'' --> display status of current branch   * ''git status'' --> display status of current branch
newdevs/git/commands.txt · Last modified: 2024/03/25 16:35 by tmccanna

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.