Git & Github Workshop Fall, 2019

Oct. 17, 2019, 1:33 a.m.
admin

Workshop Commands List

 

    1. git init - used to create local git repository in current DIR
    2. git add <filename> or .(means all) - adds files to the staging area (readying files up for a commit)
    3. git status - used to get status. it will show the difference between the working tree(most recent local REPO snapshot) and the staging area (index)
    4. git commit - take everything in staging area and and put into the local repository (take a snapshot of you files)
    5. git push - take local repository and push it to the remote repository ex. Github, bitbucket? Will ask to log in into github
    6. git pull - pull the latest changes from a remote repository (if someone makes a change to the repository and you want the latest code/version)
    7. git clone - copy/download remote repository into your current folder
    8. git config --global user.name ‘First LastName’
    9. git config --global user.email ‘emailAdress@email.com’
    10. git rm --cached <filename goes here> -  removes from staging area
    11. git commit -m ‘enter text here’ - shortcut way to make commits and skip VIM
    12.  git branch <branch name> - used to branch off the master to maybe work on new feature or bug while not having to commit to the master branch when not finished with the new feature. So master branch is not always being changed
    13. git branch - to see all branches in the repo
    14. git merge <branch name> - make sure you are in the master branch
    15. git remote - list remote repositories
    16. git remote add origin <htttp://github/RepoInfo/Info> - use the link provided by github when you create a new repo
    17. git push -u origin master - it will push you local REPO to remote github repo
    18. Git clone <http://linkToRepo> - copies entire folder of remote repo
    19. git pull - used to pull all the latest code changes