Git Commands

Git Commands

Git Commands Common git commands ​ ​ Command Description Comments git init <directory> Creates a new git repository in Not necessary when creating in the directory given. BitBucket or GitHub. git clone <repo> Creates a local copy of the repo The command to clone from <directory> given in the directory. BitBucket or GitHub is located on their websites. git add <file> Instructs git to start tracking the It is not necessary to add file(s) listed. directories, they are added when a file contained within is added. git commit Creates a checkpoint for all The second version stores changes git commit -a -m tracked files. to all tracked files and tags the “<message>” commit with a message. If the -m flag is not used, git will open a text editor to enter your message. <Ctrl>-O will write the file and <Ctrl>-X will exit the editor. git push Sends all commits to the main You must have one or more repository (server). commits in order to push. git pull Gets all commits from the main Notification is given if your repo is repository (server). up to date. git rm <file> Remove the file from tracking and delete it. git mv <source> <dest> Move the given file or directory to The tracked files are automatically another location. added. git reset --hard Removes all local changes since the last commit. git status Lists all changes since the last commit git revert <commit> Undo changes of one or more See online documentation for commits. details. More details for these commands (and others) are at: https://git-scm.com/docs/ ​ This workforce product was funded by a grant awarded by the U.S. Department of Labor’s Employment and Training Administration. The product was created by the grantee and does not necessarily reflect the official position of the U.S. Department of Labor. The U.S. Department of Labor makes no guarantees, warranties, or assurances of any kind, express or implied, with respect to such information, including any information on linked sites and including, but not limited to accuracy of the information or its completeness, timeliness, usefulness, adequacy, continued availability, or ownership. .

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    1 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us