5 Things You May Not Know About Git

Know more about git


Q: What is .gitignore and .gitkeep file?

We may not want some local files to be pushed into git repos.
Thus we specify the list or patterns in .gitignore
Git doesn't track empty directory. A file must exists within it. 
Hence .gitkeep can help us to add the empty directories into git repo.

Q: What’s git cherry-pick. Why we need it?


Q: How you create and re-create a git tag?

tag_name="tag_v1"
# Delete remote tag
git push --delete origin $tag_name

# Delete local tag
git tag -d $tag_name

# Add tag
last_commit_id=$(git log -n1 | grep '^commit' | awk -F' ' '{print $2}')
git tag -a $tag_name $last_commit_id -m "$tag_name"
git push --tags origin master

Q: How one local repo can syndicate with two remote repos?

TODO


More Reading:


Original URL: https://dennyzhang.com/mytest2

Connect with Denny In Slack Or MailList

Leave a Reply

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