GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Karteikarten

Git

Mircea Chira Computer Science Englisch 28 Karten

Karten in diesem Stapel (28)

  1. 1The .gitContains files, history, config managed by Git
  2. 2The 3 stages1 - Working directory
    2 - Staging area
    3 - Commit area
    * Github
  3. 3starting a project with gitgit init project_name
  4. 4setting up gitgit config --global user.name
    git config --global user.email
  5. 5checking the current branchgit status
  6. 6list current configurationgit config --global --list
  7. 7adding all files to staging areagit add .
  8. 8forking repositoriesfrom github -> fork , make a copy of another github repo
    git clone github.com/link to clone localy
  9. 9pull and pushit's good practice to pull before pushing to be up to date with the latest changes
  10. 10add and commit with one comandgit commit -am "mesage"
    *adds only tracked files
  11. 11checking tracked filesgit ls-files
  12. 12unstaginggit reset HEAD file_name
  13. 13reverting changesgit checkout -- file_name
  14. 14git mv file_1 file_2renames file 1 to file 2 and stages it
  15. 15git add -Aadds all files to staging area
    AND
    updates all current, moved and renamed files
  16. 16git rmremoves tracked files, git reset does not retrive the file but git checkout does
  17. 17git logshow commit history
  18. 18git showshows commit id's info
  19. 19git aliasesgit config --global alias.name "command"
    or
    vim ~/.gitconfig
  20. 20.gitignorefiles and dirs git will ignore
  21. 21the git diff and git difftool commandshows the difference between the staging area and the working directory ( in vim side by side)
    the HEAD option compares working dir with repository
    the --staged HEAD options compare the staging area with the repository
    id_1 id_2 will show changes from id_1 to id_2
    HEAD HEAD^ wil show changes from the last commit
    master origin/master compares local to pushed repository
  22. 22vimdiffone of the difftools possible settings
    add it to .gitconfig like this
    [diff]
    tool = vimdiff
  23. 23git brachesgit branch -a ----- lists branches
    git banch branch_name ------ creates new branch
    git checkout branch_name ---- switches to another branch
    git branch -m name newname --- rename
    git branch -d name -----delete
    git diff/difftool b1 b2 to compare branches
  24. 24git mergegit merge branch-name to merge current branch with branch-name
    --no--ff no fastforward merge
  25. 25git fetchupdates reference , updates what happened to the remote
  26. 26git rebaseFind out what this command does
  27. 27git stashsave changes (* to tracked files) made to be reapplied later
    the "apply" option applies the stash to current working directory
    the "list" commands provides info about the stash
    the "drop" option deletes the stash
    "-u" add untracked files
    git stash pop = git stash apply + git stash drop
  28. 28more on git stashgit stash pop = git stash apply + git stash drop
    git stash save "name" = saves stashed with name
    git stash show stash@{n} = show the nth stash
    git stash apply stash@{n}= apply the nth stash
    git stash clear = delete all the stashed
    git stash branch name = create branch switch to it and drop the stash

Informationen

Beschreibung
Computer Science Karteikarten am Git, erstellt von Mircea Chira am 21/11/2016.
Erstellt von
Mircea Chira
Aufrufe
1
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck