David542
David542

Reputation: 110093

Enter python code in the cli

I'm trying to do a shortcut where I do a git pull and then run a script. Is there any way to do the following?

$ git pull origin production && print 'hello'

I don't want to do the $ python -c 'print "hello"' but actually want to enter it into the python shell.

This is what I'm looking to do in one line in the shell:

ubuntu@ip-xxxx:~/Avails$ git pull origin production
From github.com:sideways/Avails
 * branch            production -> FETCH_HEAD
Already up-to-date.
ubuntu@ip-xxx:~/Avails$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print 'hello'
hello

Upvotes: 0

Views: 42

Answers (1)

kotrfa
kotrfa

Reputation: 1321

Couldn't you describe more what you want to achieve?

It seems to me that git hooks are made for this.

Upvotes: 1

Related Questions