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 [2017/07/18 15:47] dpproject:git_basics [2017/07/19 15:54] (current) dp
Line 33: Line 33:
 ''clone'' kloniranje svega s remote repozitorija i kopiranje na local repozitorij ''clone'' kloniranje svega s remote repozitorija i kopiranje na local repozitorij
  
-''commit'' changes go to local repo... making safe points+''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 ''push'' push changes from local to remote
Line 45: Line 53:
 ''rsync'' je ok način za prebacit repozitorij na drugo računao ''rsync'' je ok način za prebacit repozitorij na drugo računao
  
-''git fetch origin'' (povoci sve što je čovjek napravio u međuvremenu)+''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 55: 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 71: 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 =====
project/git_basics.txt · Last modified: 2017/07/19 15:54 by dp