Q & A Q & A Code

⨘ } git version control useful commands

1. clone from repository
git clone $GIT_REPOS/ip cloned-ip
where: $GIT_REPOS is path to git repository
if you like to have little fancy to organize cloned versions with dates, i prefer this way:
git clone $GIT_REPOS/ip ip-`date +%Y%b%d-%H%M`
also you can further use alias to have this command as:
alias hrclone “$GIT_REPOS/ip ip-hr-‘date +%Y%b%d-%H%M'”

2. list tags
git log –tags –simplify-by-decoration –pretty=’format:%ci %d’

3. find the difference between tags
git diff tags/ip-21ww06g tags/ip-21ww07g
if you like to print only file names changed, then use:
git diff –name-only tags/ip-21ww06g tags/ip-21ww07g

4. status – gives necessary information
git status

5. add files
git add your-file-path
adding all the files
git add -A

6. commit the changes
git commit -m “comments”

7. take changes from other repository
git pull other-repository-directory-path

 5,104 total views,  5 views today

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.