Tuesday, April 11, 2017

Git Help full command



What is sparse checkout : you basically tell Git to exclude a certain set of files from the working tree. Those files will still be part of the repository but they won't show up in your working directory.

Internally, sparse checkout uses the skip-worktree flag to mark all the excluded files as always updated. 


So onward we can pull particular required directory on that particular server via git pull. E.g. like we will use git pull on web while executing below command.


mkdir configurations
cd  configurations
git init
git remote add -f origin
https://github.com/configurations.git
git config core.sparseCheckout true
echo "web/" > .git/info/sparse-checkout
git pull origin master
git add files
git commit -m 'your comment'
git push --set-upstream origin master
git push


For git merge
git stash
git pull
git stash apply
git add
git commit
git push

For keep data from server
git checkout filename

git pull        for fetch data (checkout)
git diff         for check difference between files
git push       for push data (commit in repo)
git log         check all commit