Initially in your server computer(computer having git repo) say A, edit your gitconfig file
vim ~/.gitconfigadd the following
[alias]
serve = !git daemon –reuseaddr –verbose –base-path=. –export-all –enable=receive-pack ./.gitsave it. now determine your computer’s ip-address via
ifconfigto enable push run the following command
git config receive.denyCurrentBranch ignorenote the ip address of your computer and run git serve by typing
git servenow in another computer SAY B, you can clone the repo using following command
git clone git://YOUR_IP_ADDRESS/ directory_to_add_repo_tonow you have cloned the repo
make edit, add, commit, pull and push, after the push operation you can close the connection in computer A by pressing [ctrl]+c
now you need to run git hard reset to see the changes in computer A, to do that run
git reset --hardNow you can see the changes merged
Note: –hard Resets the index and working tree. Any changes to tracked files in the working tree since are discarded.
