Skip to main content

Posts

Showing posts with the label git

How to delete a remote git tag

I'm always forgetting this. So decided to put it here for someone's benefit. I have the git tag added by command: git tag -a 1.2 . 0 -m "1.2.0" this means my tags tree will be updated with the tag 1.2.0 and message 1.2.0 Usually it marks the version of the build/release. I now push a tag to origin by command: git push origin --tags It is possible to see it at my repository github tagged. Time now to delete a tag. It can be done by command: git tag -d 1.2 . 0 This will remove a local tag 1.2.0. Leaving origin intact. Pushing tags to origin does not give anything. To remove a remote tag now it is required to execute command: git push origin :refs/tags/ 1.2 . 0 It will remove tag 1.2.0 at origin. This is the only way how to move tags to another commits.

Git tag and versioning your project

We use tags to version our project. I will set up here basic commands we use on everyday basis and may use to handle some issues. Showing your tags Listing the available tags in Git is straightforward. Just type git tag . $ git tag 1 . 0 . 7 1 . 0 . 8 1 . 0 . 9 1 . 1 . 0 Adding tags To add tags you may do git tag tagname . But better to specify args to be able to use in scripts: $ git tag - a 1 . 1 . 1 - m "major improvements" $ git tag 1 . 0 . 7 1 . 0 . 8 1 . 0 . 9 1 . 1 . 0 1 . 1 . 1 Here we have added a tag version 1.1.1 with commit message "major improvements" . Uploading to repository I assume you have a GitHub repo. So to push your tags there run git push (for your tagged commits commits) and then push your tags: $ git push Counting objects : 120 , done. Delta compression using up to 4 threads. Compressing objects : 100 % ( 59 / 59 ) , done. Writing objects : 100 % ( 69 / 69 ) , 390 . 70 KiB , done. Total 69 (...

Pretty git Log

SO you dislike git log output in console like me and do not use it... Because it looks like so: How about this one? It's quite easy... Just type: git log - - graph - - pretty = format : '%Cred%h%Creset -%C ( yellow ) %d%Creset %s %Cgreen ( %cr) %C ( bold blue ) <%an>%Creset' - - abbrev - commit - - It may be hard to enter such an easy command every time. Let's make an alias instead... Copypaste this to your terminal: git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --" And use simple command to see this pretty log instead: git lg Now in case you want to see lines that changed use: git lg - p In order for this command to work remove  the -- from the end of the alias. May the code be with you! NOTE: this article is a rewritten copy of  http://coderwall.com/p/euwpig?i=3&p=1&t=git   and have b...

How to setup Git to work with Eclipse.

Git is a best version control system, as for me. That's why I decided to write a few words about setting up a git GUI for yourself. I assume you use Eclipse for your everyday coding. As long as your project is small and you simply committing for co-working with other project members everything is ok with command line tools of Git. I made commits on a daily basis. Main commands I used was: "git add", "git remove", "git commit -m", "git push"... It's ok when you commit 5 to 20 files. You can manually add them. It takes about some minutes. One day a project grown up.  Commits became a hard typing work. So that's the manual how to befriend your Eclipse with Git(hub). 1. Install Eclipse plugin called EGit. It is well documented and highly sophisticated Eclipse plugin for working with Git. You can read almost any step of setting up this plugin in it's official docs: http://wiki.eclipse.org/EGit/User_Guide . It's quite cool a...

Hello World!

Hi! I'm a junior web developer/programmer studying Python/JavaScript programming. In this blog I'll try to publish my findings and things I achieved or studied so far. So I'm working with: - Python - Django - JavaScript - jQuery My Github is:     garmoncheg I'm making an OpenSource project Gphblog (Garmoncheg's Photo Blog) there. Feel free to contact me about any topic listed here...