[git-users] Getting the latest tag
I found two ways to get the latest tag but what is difference, if there is a difference? Solution 1: git describe --tags $(git rev-list --tags --max-count=1) Solution 2: git for-each-ref refs/tags --sort=-authordate --format='%(refname)' --count=1 | sed 's/^refs\/tags\///' -- You received this message because you are subscribed to the Google Groups Git for human beings group. To view this discussion on the web visit https://groups.google.com/d/msg/git-users/-/RDuvi8r0Gk4J. To post to this group, send email to git-users@googlegroups.com. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/git-users?hl=en.
[git-users] git fetch question
I have a local repo and a remote repo, something, both contain the branch develop. Before I do a git fetch git rev-parse develop - SHA1 git rev-parse something/develop - SHA1 $git checkout master $git fetch something $git rev-parse develop SHA1 $git rev-parse something/develop SHA2 $git status Your branch is behind by x commits Perfect, just as I expected. But what if I don't want to do a git fetch something The reason for that is that I would be fetching a whole lot more than I need. The remote repo has several other branches that I have no need for. I would like to do something like git fetch something but only for one branch. If I do git fetch something develop, it ends up in FETCH_HEAD, if I do git fetch something develop:develop you get: $git checkout master $git fetch something develop:develop $git rev-parse develop SHA2 $git rev-parse something/develop SHA1 $git status Your branch is ahead by x commits So is there a way to update the SHA in something/develop? I want to use this in a script, comparing the local branch and remote branch. -- Peter van der Does GPG key: CB317D6E IRC: Ganseki on irc.freenode.net Twitter: @petervanderdoes -- You received this message because you are subscribed to the Google Groups Git for human beings group. To post to this group, send email to git-users@googlegroups.com. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/git-users?hl=en.
Re: [git-users] bash SHA-1 completion
On Mon, 8 Jul 2013 11:41:09 -0700 (PDT) Andy From andyf...@gmail.com wrote: Hi, I wonder if there's been any work on providing SHA-1 tab completion for any command (e.g. show or diff) ? Completion works fine for e.g. branches but it might be a convenience feature to also be able to complete on SHA-1. Maybe there would be some performance drawbacks on this and there's been some discussion on this already... BR, A There could be major performance drawbacks, memory problems and just the shear amount that will be displayed. Completion works on the principal of getting all potential completions in memory and then showing them. So for example with branches, git checkout bTABTAB All branches that start with b are loaded in memory and displayed. Now imagine this with all your commits. Do a git rev-list|wc -l on your repository and see how long it takes and how many commits you have. For the kernel repo for example: $time git rev-list --all | wc -l 419811 real0m5.209s user0m4.881s sys 0m1.280s So 419811 possibilities would be displayed after you do git diffTABTAB Assume you know the SHA1 starts with e $time git rev-list --all | grep ^e | wc -l 26365 real0m5.826s user0m6.223s sys 0m0.923s 26365 possibilities on git diff eTABTAB -- Peter van der Does GPG key: CB317D6E Site: http://avirtualhome.com GitHub: https://github.com/petervanderdoes Twitter: @petervanderdoes -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [git-users] Installing GIT on Ubuntu 12.04
On 07/17/2014 12:12 AM, Ellick Marquez wrote: Hi everybody, I want to install git on my computer with ubuntu 12.04 but when I put the next code sudo apt-get install git on my terminal, it shows me that the package git was removed or it doesn't exist. Please help me, I really need to use GIT To install you have to use sudo apt-get git-core But 12.04 gives you git 1.7.0.4. If you want the latest version check out my PPA: https://launchpad.net/~pdoes/+archive/ubuntu/ppa Currently it has version 2.0.2 available for Ubuntu versions: - 10.04 (Lucid) - 12.04 (Precise) - 13.10 (Saucy) - 14.04 (Trusty) Just add the PPA and use sudo apt-get install git. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [git-users] Enforce C# code style with git hooks
On 01/13/2015 02:35 PM, Marko Paloski wrote: Hello, I want to make i script that check the code style in the commit, so if don't matches, it will not allow the developers to commit the code. The script will be in pre-commit local or in pre-recieve on the server. I find something about uncrustify : http://www.itk.org/pipermail/insight-developers/2010-September/015333.html http://uncrustify.sourceforge.net/ https://github.com/bengardner/uncrustify But i don't know how to implement. Yes it can be bash or powershell script. Thanks, I don't know uncrustify, how can you tell with uncrustify if code is not in your preferred code style? -- Peter van der Does GPG key: CB317D6E Site: http://avirtualhome.com GitHub: https://github.com/petervanderdoes Twitter: @petervanderdoes -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [git-users] Enforce C# code style with git hooks
On 01/13/2015 02:35 PM, Marko Paloski wrote: Hello, I want to make i script that check the code style in the commit, so if don't matches, it will not allow the developers to commit the code. The script will be in pre-commit local or in pre-recieve on the server. I find something about uncrustify : http://www.itk.org/pipermail/insight-developers/2010-September/015333.html http://uncrustify.sourceforge.net/ https://github.com/bengardner/uncrustify But i don't know how to implement. Yes it can be bash or powershell script. Thanks, In the file .git/hooks/precommit you run the uncrustify analysis and depending on the result, you exit the script with 0 if it was ok, and 1 if it was not ok. If you exit with a 1 the commit will not be done. -- Peter van der Does GPG key: CB317D6E Site: http://avirtualhome.com GitHub: https://github.com/petervanderdoes Twitter: @petervanderdoes -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[git-users] git fetch deletes remote references
Hi, I set fetch.prune on an existing repository. If I push a new tracking branch to the remote and fetch the remote branch, the reference to the remote branch is deleted. Is this expected behavior or a bug? Using git 2.6.3 on Ubuntu. Doing the following commands on a existing repository. $ git config fetch.prune true $ git checkout -b bug/bug-1 Switched to a new branch 'bug/bug-1' $ touch bugfix $ git add . $ git commit -a $ git push --set-upstream origin bug/bug-1 Counting objects: 2, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (2/2), 242 bytes | 0 bytes/s, done. Total 2 (delta 1), reused 0 (delta 0) To g...@github.com:petervanderdoes/Testing.git * [new branch] bug/bug-1 -> bug/bug-1 Branch bug/bug-1 set up to track remote branch bug/bug-1 from origin. $ git fetch origin bug/bug-1:refs/remotes/origin/bug/bug-1 >From github.com:petervanderdoes/Testing x [deleted] (none) -> origin/bug/bug-1 $ git branch -r origin/master $ git branch * bug/bug-1 master The branch bug/bug-1 does still exist on github. Peter -- Peter van der Does GPG key: CB317D6E Site: http://avirtualhome.com GitHub: https://github.com/petervanderdoes Twitter: @petervanderdoes -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.