Skip to content

Latest commit

 

History

History
107 lines (64 loc) · 4.49 KB

File metadata and controls

107 lines (64 loc) · 4.49 KB

#Dictionary

-Git: Timeline of your project -GitHub: The way to store online -git can track all files in sub-folders, initializing git in subfolders is not needed -developing area = project folder in the computer -github = exists "online" .git folder = local repository = where the timeline exists (and thus all you versions) check ls -la if .git folder is there between develop and local repo = staging erea staging area = after add commands, place to organize/prepare how your commit should look like git commit = send to local repo local repository = where your versions are kept

changes to be commited = in staging area and added changes not staged = a file that was commited before but this version not yet untracked first time git sees this file and was never committed yet! 4th conceptual area = remote repository = github

git commit -m flag only allows linear message with constraint on length

why is staging with git add so important? to organize commits and making your timeline as comprehensive as possible when working on different files in a project staging area you can organize files that are related or have related changes

readme : documentation about what and how of the repository, complete description, front page of your github gitignore = files inthere but git can ignore, big data files that are always the same

.gitignore a list won't be tracked, it will be ignored eg *.csv ignore all csv files !dataset.csv except this #make a comment subdirectories can be ignored as folder/

files in subdirectories don't have to have paths specified

you can only see the history of the branch you are inbranches give alternative history commits and has a specific name independent timelinecyou commit only in that branch the have a common ancestor but can be merged back in time head = last version of each branch, so number of branches = number of heads git diff and git show can not be used to compare versions in different branches a branch can also be created from a previous version

#commands info -git init = creates an empty timeline in a folder -git commit -m "meaningful message" saving a point in timeline, include description of the change why, how issue adressed, effects, limitations <<<<<<< HEAD -git config --global --list = check if git has your information -git config --global user.name "username" = change your git username -git config --global user.email "my email adress" = change email adress -git add = create another file -git commit -meaningful message -git restore --staged, goes back to untracked or not staged depending on what it was beofre -git status = check which files are in what developing area -git log = check all commit history flags --help -n (limit number of commits to most recent) --abrev-commit: commit smaller unique id -git diff commitid1oldest commitid2newest = compare different commits, oldest version always first flag with --stat to show all insertions and deletions -git show similar behavior, it will show both commits how they look

  • git remote set-url origin git@github.com:obertelo/git_project.git (solves the problem for asking authentication)
  • git push --set-upstream origin master = connecting local to remote
  • git pull = connecting remote to local (request to pull from github)

git reset not reccomended git revert id = undo last commit, git revert HEAD~3 last three git clone https://github.com/vibbits/introduction-github.git (https) to clone from a repo you do not own or collab on git clone https://github.com/obertelo/git_project.git (ssh) to clone your own repo from your github that was locally lost git revert after a revert, undoes skipping one commit

-git branch branchname = create a new branch -git checkout branchname to move between branches -git status will tell you which branch you are in -git branch -a will tell you whch branch you are in and chich branches are local and remote -git checkout -b branchname will create branch and immediately bring you into this branch (so a combo of git branch and checkout) -git branch --list gives a list of branches

git can track changes in files, but not images, pdfs and word files will be able to read csv's every time a new branch is pushed git push --set-upstream origin branchname needs to be done

git will show in your folder what branch you are in locally! so make sure you are in the branch

you can compare in different branches between branches

SO MANY CHANGES HAVE BEEN MADE

someotherbranch