git

By alexmoreno, 9 April, 2018

Everything starts with a problem trying to checkout your repository master branch:

git checkout master
error: pathspec 'master' did not match any file(s) known to git.

Trying to checkout origin does not improve things, but at least is a step forward:

By alexmoreno, 10 February, 2013

Look mom, without hands...

First, change this in your .git/config:

old url:
 url = https://[email protected]/hispamedios/PROJECT.git
new one:
url = ssh://USER.bitbucket.org/hispamedios/PROJECT.git

 

Edit your .ssh/config, in your local directory, and add this:

 cat .ssh/config
Host YOURUSER.bitbucket.org 
HostName bitbucket.org 
User git
IdentityFile ~/.ssh/bitbucket

The last line is important, so you are indicating your identity file. Now create this file:

By alexmoreno, 10 February, 2013

 

removing some folders from git, file .gitignore with these contents:

 

# Ignore paths that contain generated content.

cache/

files/

sites/*/files

sites/*/private

 

 

 

Using symbolic links for /files directory:

 

 

namespace:custom do

    task:symlink do

      run "ln -s /var/www/crucerista/sites/crucerista.net/files/ /var/www/crsta/current/sites/crucerista.net/"

      run "echo 'finished'"

    end

end

after "deploy","custom:symlink"

 

 

By alexmoreno, 27 January, 2013

All you need to know to start faster in Git:

  • sudo git add .
  • sudo git commit -m "function findFriends added"
  • git push -u origin master

That's it :-)

By alexmoreno, 7 December, 2012

There is a simple way of upgrading or executing a command immediatly after a push has been done.

We just need to go to the server repository (the one which is going to receive the push), and enter in hooks (.git/hooks or hooks if it's a bare repository).

Then, we rename the post-receive.sample to post-receive, without extension, and add this content:

echo "********************"

echo "Post receive hook: Updating User Staging"

echo "********************"

cd ../live

GIT_DIR='.git'

git pull origin master

By alexmoreno, 30 November, 2012

 

IN BLESSED

mkdir gitlab/blessedrepo

cd gitlab/blessedrepo

git init

 

Creating new files:

vim README

adding:

git add .

git commit -m "first file in blessed repository"

git push

 

IN DEVELOPERS

mkdir developer2

cd developer2

git clone /Users/air/gitlab/blessedrepo

ls

blessedrepo

ls blessedrepo/

README

cd blessedrepo

vim fileindev2.html

git add .

 

 

MacBook-Air-de-Air:blessedrepo air$ git commit -m "added file by developer2"

By alexmoreno, 6 November, 2012

Let me got directly to the point. The bitbucket documentation is wrong, on the begining you are just suposed to do a git remote add origin

in the directory which you want to commit. But this will not work:

fatal: Not a git repository (or any of the parent directories): .git

Solution? Init the repository:

git init

git remote add origin https://[email protected]/ACCOUNT/REPOSITORY.git

git push -u origin master

will also don´t work :-(. The problem is that the message error is all but obvious.