Git installation and configuration
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
git config --global user.name #global for user --system for global git config --global core.ui git add . git init git commit git log --grep="" git status git add #add to staging git commit -m "" git diff (--online) git diff --staged #changes in stage index and respository git rm # followed with git commit git mv # similar to git rm git checkout -- index.html #retrieve from repository to replace staging git checkout -- shum-code #revert to older version to git diff shumid..shumid [filename] git diff shum-id -b /-w #+BEGIN_SRC sh |
Two tree architecture: Three tree architecture:
Setting up GIT version control for ORG files
Setting a central repository in WD CLOUD – a NFS file server with all working copies
- rsync -av or scp -rp file to NFS server
-
Initialize GIT repository
123git init -
Set global configuration
1234git config --global user.email "myemail@memoryimprintstudio.com"git config --global user.name "your name" -
Add files to the repository
1234git add *.orggit add ./* -
Commit
123git commit -a -m "initial source import"
Create another bare repository with only history without working copies. This should be implemented in another remote computer in order to enhance your security karma.
-
Getting Git on a server (follow link here), create a bare repository with following
123$ git clone --bare my_project my_project.gitThe rational for a bare repository is following: 1) it is a bad practice to push back to a repository with full working copies; 2) and git will complain LOUD; 3) an independent bare repos will increase your karma for backup capability.
-
Upload the bare repository to your Server
123$ scp -r my_project.git user@git.example.com:/opt/git
Create a local branch with working copies to bare repos
-
Clone to create the branch (ssh used here)
1234git clone url directorygit clone ssh://ian@yourgitserver/~/Documents/org ~/ -
Merge local changes change the status of your local GIT repos with following
123456git diffgit statusgit add # add new files to trackgit commit -a -m "comments" # to commit123git push -
Updating an Existing Branch of Your org Files. Same code used to update your central working repos (pull from bare repos).
123git pull
Install in Windows 7
- Install Git for windows
- Run GIT bash
-
Create a clone from bare repository
Here is the work flow for the system
FEB
About the Author:
Beyond 8 hours - Computer, Sports, Family...