User Tools

Site Tools


project:git_basics

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
project:git_basics [2016/06/20 14:49] dpproject:git_basics [2017/07/19 15:54] (current) dp
Line 31: Line 31:
 ''remote'' u git terminologiji je repozitorij koji je negdje drugdje (u drugom direktoriju ili na mreži) ''remote'' u git terminologiji je repozitorij koji je negdje drugdje (u drugom direktoriju ili na mreži)
  
-''rsync'' je ok način za prebacit repozitorij na drugo računao+''clone'' kloniranje svega s remote repozitorija i kopiranje na local repozitorij
  
 +''init'' uđi u folder, initialize a repository on a new folder or existing one
  
 +''.git'' folder u kojem git sprema sve (nije backup) ... delete to destroy repository
 +
 +''.gitignore'' specify files and file patterns for git to ignore (create file: ''touch .gitignore'' and add e.g. *.log)
 +
 +''commit'' changes go to local repo... making safe points...
 +
 +''git commit -m "description"'' dodavanje opisa uz commit, u protivnom se otvori vim editor
 +
 +''push'' push changes from local to remote
 +
 +''pull'' sync lokal s remote repozitorijem. povuci sve promjene s remote repozitorija koje nisu u lokalnom repozitoriju.
  
 ''rebase'' (tvoj commit stavlja kao zadnji (na vrhu) master brancha) ''rebase'' (tvoj commit stavlja kao zadnji (na vrhu) master brancha)
  
-''git fetch origin'' (povoci sve što je čovjek napravio u međuvremenu)+''pull --rebase'' ensures that your changes commited localy will always be put on top of anything you pull from remote 
 + 
 +''rsync'' je ok način za prebacit repozitorij na drugo računao 
 + 
 +''git fetch origin'' s remote repozitirija povuci sve promjene napravljene u međuvremenu (od zadnjeg cloniranja ili fetch-anja)... fetching povuče sve promjene u lokalni repozitorij, ali ih ne merge-a. 
 + 
 +''git pull origin'' will automatically fetch and merge the changes from the remote branch into your current branch 
 + 
 +''git push origin master'' we are telling git to push our changes to the remote repository known to us as origin and commit them to the master branch 
 + 
 +''git remote add IME_DODATNOG_REPOZITORIJA http://git...'' adding additional remote repositories
  
 ''diff'' (pogledaj trenutno stanje u odnosu na master) ''diff'' (pogledaj trenutno stanje u odnosu na master)
Line 47: Line 69:
 ''git grep -i'' (case insensitive) ''git grep -i'' (case insensitive)
  
-''git status''+''git status'' check status of the repository ... what files are untracked 
 + 
 +''git add'' stage a file for commit
  
 ''pre commit hook'' (nešto što se projavi prije comminta pa se može nešto napraviti npr. izbrisati spejsove (davor!)) ''pre commit hook'' (nešto što se projavi prije comminta pa se može nešto napraviti npr. izbrisati spejsove (davor!))
Line 63: Line 87:
 ''git push'' ''git push''
  
-''git add .'' ("." current directory)\\  +''git add .'' ("." stage everything in current directory)\\  
-''git add *''+''git add *''\\ 
 +''git add *.txt'' 
 + 
 +''git branch IME_NOVOG_BRANCHA'' create new branch 
 + 
 +''git checkout IME_NOVOG_BRANCHA''  
 + 
 +''git checkout master'' switch back to the main branch 
  
 +''git merge IME_NOVOG_BRANCHA'' ... ali i potencijalni konflikti...
  
 ===== Primjer grupnog rada ===== ===== Primjer grupnog rada =====
Line 137: Line 169:
 mkdir f32c/ mkdir f32c/
 cd f32c/ cd f32c/
-git init (????)+git init
 git submodule add https://github.com/f32c/f32c git submodule add https://github.com/f32c/f32c
 git submodule add https://github.com/f32c/arduino git submodule add https://github.com/f32c/arduino
project/git_basics.1466426961.txt.gz · Last modified: 2016/06/20 14:49 by dp