Showing posts with label git. Show all posts
Showing posts with label git. Show all posts

23 October 2019

How to fix error :xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun after update to MacOS Mojave ?

Solution for

  • Git
  • macOS Mojave 10.14.x


STORY:
Did you upgrade your amazing macOS Mojave? Did you wish to crack on your project and start to use git but you were hit with error: 
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun


SOLUTION:
You need to install Command Line Developer Tools, so simply run this command:
xcode-select --install

16 June 2016

How to replace command line with git bash in IntelliJ ?

IntelliJ  has an ability to run terminal inside ,but it uses cmd.exe but most of us ,specially these people who use git ,use git bash instead . So you ask yourself; can I replace it ?

Yes, you can!

You just need do few simple steps:
  • Press Ctrl+Alt+S (Open settings)  (anywhere on main screen)
  • Search for terminal in search-box (top left)
  • change path to : C:\Program Files (x86)\Git\bin\sh.exe" --login -i [change path to yours, this is default one for 32 bit version of git bash on Windows)
  • Done :)
  • Open terminal and ... ta daam Git bash is there instead of cmd.exe :)

    20 April 2016

    Coolpointer.003 .git

    What is Coolpointer ? Check this : http://dominiksymonowicz.blogspot.co.uk/2015/12/coolpointerintroduction.html

    Understanding git for real by exploring the .git directory

    This article helps me to understood how the core concepts of git works. It worth to read it if you are use git and you are curious about details. 

    22 December 2015

    How to solve problem with error "CreateProcess error=2, The system cannot find the file specified" in IntelliJ IDEA and Git ?

    Solution works for
    Windows
    IntelliJ IDEA (I tested on v14  and v15 but you may try it on earlier version too)
    git (I tested on version 2.x ,but I am sure,it will work with earlier version)

    PROBLEM:
    You install git,IntelliJ
    You tried to open

    ERROR:
    "CreateProcess error=2, The system cannot find the file specified"

    SOLUTION:
    There can be 2 possible cause of this problem:
    A. You install git in unusual place, so IntelliJ cannot find it.
    B. You are behind proxy that blocks git


    If you see above error ,it means that IntelliJ doesn't know where git was installed,so you need set it.
    However, before you follow below setup:
    • Make sure that git is installed (Download from: https://git-scm.com)
    • Make sure you set path in Windows environment (Go to Control Panel -> All Control Panel Items -> System -> Advance System Settings -> Environment Variables -> Select  System Variables and in the end add ; and path path to cmd folder of git ... for example 
      • ;C:\Program Files (x86)\Git\cmd)
    • If you error appear during creating a project (for example if you create a new project using existing resources using Gradle) ,then you need create new empty project .
    • Are you at work ? Don't forgot set proxy in IntelliJ IDEA (below is instruction where to find proxy)
    So... to solve problem you need:
    1. Open project 
    2. Go to Settings (File -> Settings or press Ctrl+alt+s (on Windows and Linux)) 
    3. In setting search for git or go to Version Control and select Git 
    4. set Path to Git in  "Path to Git executable :"
    5. Apply and OK:)

    How to setup proxy
    1. Go to Settings (File -> Settings or press Ctrl+alt+s (on Windows and Linux)) 
    2. Search for proxy or go to Appearance & Behavior -> System settings -> HTTP proxy
    3. Set your proxy (ask DevOps or IT support ,if you don't know :)

    Problem solved.

    In 99% of cases :
    "CreateProcess error=2, The system cannot find the file specified"
     it means, that you didn't setup path to executable to some plugin/module or you didn't install software that IntelliJ needed to run or you didn't setup a proxy

    If your proxy setup is correct ,then  open IntelliJ 's log file and see error message where you should see which program caused problem (for example git),then check IDEA support website how to install specific module/plugin and it should solve problem.

    Have an epic development!

    25 September 2014

    Is Git Bash affected by Shellshock Bash bug?

    YES :(

    I run test on my git bash on the Windows machine as described here :
    http://www.troyhunt.com/2014/09/everything-you-need-to-know-about.html

    "type:
    env X="() { :;} ; echo busted" /bin/sh -c "echo stuff"
    You get “busted” echo’d back out and you’ve successfully exploited the bug."

    Is it end of the world ?
    I think so,because Mac users are affected too !  :)

    What is Shellshock Bash bug?
    Description can be found on nist website: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-6271 . I can write some rubbish about it,but I think,it is better,if I point you to awesome link that explain things much better than I could do. http://www.troyhunt.com/2014/09/everything-you-need-to-know-about.html


    Don't panic people.
    If people in Stone Age survived without internet ,we can too !


    20 March 2014

    Git notes

    WARNING!
    This is personal notes for personal and my friends only:
    http://dominiksymonowicz.blogspot.co.uk/2014/01/itnotes-information.html
    You can read them,but I suggest look to link,resources only


    Git is a distributed revision control and source code management tool.

    Book:


    1. Pro Git (book is free,but if you use ,please buy it)

    Articles:
    Useful command and command combos:
    • Change name of the current branch:
      • git branch -m newname 
      • where newname is the name of the branch
    • Undo modified file
      • git checkout -- pathToFile
      • where pathToFile is a file (path to file, that should be deleted (git status display all modified file  or actually the path to them, just copy it and use as  pathToFile  )
    • How change message from the last commit to Git?
    • -force-with-lease
      • use -force-with-lease instead -force-force-with-lease effectively only allows you to force-push if no-one else has pushed changes up to the remote in the interim.
    • How to remove all untracked files
      • git clean -df
    • A nice shortcut for quick commit, where you add all files and commit them to the message.
      • git commit -a - m "Describe your job or title from Jira "
    • How to cancel and undo merge, if you have conflict problems  
      • git merge --abort
    • Delete all uncommitted changes  
      • git checkout -- .
    • How to recover from shit happens like lost commit? Use Reflog which is a shortcut for Reference logs.
      • git reflog
    • How to clean in optimise repository. (-- aggressive should be used once per few hundreds commit) 
      • git gc --aggressive
    • How Using command line but prefer to have a more readable output of commits? Use this:
      • git log --graph --pretty=format:'%C(bold blue)%an%Creset %C(green)%cr %C(red)[%H]%Creset -%C(dim yellow)%d%Creset%n   %C(ul magenta)%s%Creset ' --abbrev-commit --date=relative
    • How to clean in optimise repository. (-- aggressive should be used once per few hundreds commit) 
      • git gc --aggressive
    • To avoid messy merge commits and help keep a relatively clean git commit history use the following workflow when fetching upstream changes:
      • git fetch origin and then git rebase -p origin/develop
    • Fancy change author name of commit?
      • git change-commits GIT_AUTHOR_NAME "old name" "new name"
    • Get fed up with merge the same conflicted changes over and over again? Enable this feature make you life less painful.
      • git config --global rerere.enabled true
    • Stop tracking a tracked file
      • git rm --cached file.json


    Sources:






    15 July 2013

    How to Undo delete file in git ?

    Did you delete a  file by accident ?
    (due misclick , you went wild while you drunk and decide to delete file or as me you delete file without wear a glasses first.).

    What to do ? Well, In normal cases,below steps are enough ..

    1) Go to right project directory
    2) type:
    • git reset HEAD *DeletedFile.name
    3) type:
    • git checkout *DeletedFile.name
    4) type:
    • git status to ensure that everything went smoothly

    If you got into deep trouble,then search in stackoverflow as they have many solutions for various bizarre cases .

    And advice to myself:
    Do not delete files without wearing glasses first.

    8 November 2012

    How change message from last commit in Git?

    STORY:
    Is your manager is a grammar Nazi ,so She/He/It complains about your grammar mistakes in your comment in last Git commit ? If yes, or if you just want change message in your last commit,then... Question is how to change last commit message?

    SOLUTION:
    git commit --amend -m "A new corrected commit message"



    SOURCE:
    http://stackoverflow.com/questions/179123/how-do-i-edit-an-incorrect-commit-message-in-git

    7 September 2012

    how to back to shell in git bash after git log (and some similar command) ?

    STORY:
    You type in :
    git log
    and you can see logs ... lots of logs,but when you finish ,then you wondering how to back ... using your intuition ,you press ... ESC ... which surprise surprise ... doesn't work.

    SOLUTION:
    press q
    yes ... one key solve your probem.
    q stands for quit . tricky, is it?

    5 September 2012

    How to cancel , delete remove git flow feature , hotfix or release ?

    STORY:
    So you create awesome feature/hotfix/release and then you released that you don't need it for whatever reason, but ... you discover that git flow doesn't have magic command  'delete' .
    You found that is issue was reported (#47 ability to delete/remove release/hotfix/features easily Feature) ... 2 years ago ... and nothing happen since then.

    PROBLEM:
    No ability to cancel/delete/remove  feature/hotfix/ release  easily.

    SOLUTION:
    Suprisely, this ability exists! Git can do that! Simply:
    git branch -d feature/your-abandoned-feature

    feature/your-abandoned-feature  - is name of your branch :)

    EXAMPLES:
    git branch -d hotfix/give-child-sleeping-pill
    git branch -d feature/your-abandoned-feature
    git branch -d release/version-111.0-bulid1234567890-date20501231


    6 June 2012

    Useful link:Great article about branching model to Git

    My workmate found a great article written by Vincent Driessen about how to branching model for Git.
    'Must read' article for people who using Git in their project.

    Link: http://nvie.com/posts/a-successful-git-branching-model/

    17 February 2012

    How to solve problem with HermesJMS crash when you try choose file ,if you have Git (msysgit) is installed ?

    This is bypass solution.It will solve problem but has some side effects

    STORY:
    If you have Windows XP SP3 (32bit), JDK  6 (checked on 1.6.0_21  1.6.0_24  , HermesJMS 1.x (checked on 1.13 and 1.14) and Git (checked on 1.7.3) ,then you can belong to bunch of annoyed users, who has big trouble with using HermesJMS which simply crash every time when you need open "Select file/folder" dialog ,like "Open configuration" and etc.
    Only what you will see is a a new file hs_err_pid13196.log (number is different every time) with mighty message that "A fatal error has been detected by the Java Runtime Environment:" with lots debug information.
    When you go to hermes site,then you will find few threads like:
    http://hermesjms.org/forum/viewtopic.php?t=1026
    or JIRA tickets:
    http://hermesjms.org/jira/browse/HJMS-135
    http://hermesjms.org/jira/browse/HJMS-156
    where we see that problem  "Won't Fix" and author only said  
    Author of program answered: " This looks like a windows/DLL/JVM install issue and is not something I can fix.

    ARE WE DOOMED? No.

    SOLUTION:
    So what to do ?

    You need to disable a git shell...

    How?
    1) Open command line interface  (Start/Run , type cmd)
    2) Simply go to folder where you install your git folder(default place:) C:\Program Files\Git\git-cheetah (cd  C:\Program Files\Git\git-cheetah )
    3) regsvr32 /u git_shell_ext.dll
    and.... HermesJMS will works...

    SIDE EFECTS:
    Unfortunately ,that means that from now you need  run Git Bash  from menu start (or create shortcut in place where you using git or hand make "right click" using one of many tools to tune windows)

    3 May 2011

    Useful link: EGit tutorial

    If you want learn how to use EGit plugin for eclipse .I suggest read this tutorial.
    Is simple and very well written.

    Link:egit tutorial for beginners by unicare