Server Setup
1.Create a base folder "E:\GIT_SERVER"
2. run following command to create new repo called "Test"
3. below command will create a folder named "Test.git" inside required folders and configuration files for this repo
$ git init Test.Git --bare
Network Sharing
To access this GIT server (win-srv) within intranet share this folder to access it from other machines
Step 1: Share above created base folder "E:\GIT_SERVER" in LAN
Ex: Access to "Everyone" by right click the folder
Step 2: Control Panel > Network And Sharing Center > Change advanced sharing settings
Check "Turn on network discovery" (under "Private/Public/All Networks" sections)
From Development machine
$ git clone //win-srv//git_server//test.git
$ git status
$ git add test.txt
$ git config --global user.email "cheng"
$ git commit -m "changed from devpc"
$ git remote add origin //win-srv//git_server//test.git (if, required)
$ git push origin master
Branch & Merge, if required
1) Make your local changes
2) try to commit and push and if it says difference in history (then someone else check-in)
3) now you can create a new branch and merge with master (original) by follow below setup of commands
$ git checkout -b temp
$ git checkout master
$ git merge temp
finally delete the temp branch as below
$ git branch -d hotfix
git --rest HEAD^
git pull origin master
How to find difference & merge
$ git diff
$ git pull --rebase origin master
$ git mergetool (:wq/:wq/:wq)
$ git --rebase continue
$ git push origin master
How to update/map new source control server IP (if its changed)
$ nano .git/config
$ git pull