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

Thursday, October 25, 2018

macOS Mojave doesn't recognize git



Who doesn't want dark mode on mac!

However, after updating the macOs to Mojave, if you try to access git on your command prompt, it throws below error -

$ git
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun


All you need to do is reinstall the xcode command line tool using following command -

$xcode-select --install

It should run fine after that.

Monday, July 29, 2013

Setup email notification for team on github commits

Once more than one person start working on some code its good to get notification on what other team mates are committing and with git repo its easy to setup this with help of google groups.

  1. Create a new google group. Add one member - noreply@github.com
    Add the team/users email address which should be same as their github email id, the one they using it to access repo.
  2. Go to Github repository.
  3. Click on Settings from right navigation.
  4. Click on Service Hooks from left navigation.
  5. Click on Email - Provide google group name you have created (@googlegroups.com).
  6. Click Update the settings.
  7. Check its working fine by click on 'Test Hook'.

At the end you should get sample test email with last commit. After this setup all team members/members of google groups will get email upon commit from anyone on the repo.

Wednesday, November 21, 2012

Push new code to Github

Create new repository (push fresh code to github)

1. Execute below steps (commands) in your local first - (g
o to the folder which you want to push to github)

git init
git add .
git commit -m "Initial commit"


2. Create new repo on github (using add new repository)
e.g. MyProject - https://github.com/jpa/myproject.git

3. Again go back to your local and use below commands to push the code

git remote add [name to use for remote] [private URI] # associate local repo to the remote
git push [name of remote] master # push your repository to the remote


Sample steps for it -

git remote add origin https://github.com/jpa/myproject.git

git fetch origin #It will pull the ReadMe file from git repository which you created on it.
git merge origin/master #Merge the changes with the local files.
git push origin #push the code.


All Set :)

Sunday, November 4, 2012

git cache issue (.gitignore)


Run into strange issue today, i had added few files/path of the files in .gitignore, though while doing git status it were keep coming up. I explicitly specified the file names in .gitignore, however it ignored my additions to .gitignore :(

After spending some time, went to stackoverflow/google and figured the solution.

If you running into similar issue,  following is the solution:

Remove the cache -
git rm -r --cached .

This removes everything from the index, then just run:
git add .


Commit it:
git commit -m ".gitignore cache fix"


It should be fine now, check -
git status