Tuesday, January 9, 2018

create, push, view bitbucket branches

Before creating a new branch, pull the changes from upstream. Your master needs to be up to date.
Create the branch on your local machine and switch in this branch :
$ git checkout -b [name_of_your_new_branch]
Change working branch :
$ git checkout [name_of_your_new_branch]
Push the branch on github :
$ git push origin [name_of_your_new_branch]
When you want to commit something in your branch, be sure to be in your branch. Add -u parameter to set upstream.
You can see all branches created by using :
$ git branch
boroo@homework MINGW64 /d/Projects/Python.Projects/maths (branch1)
$ git commit -m "change by branch1"
[branch1 f493b16] change by branch1
 1 file changed, 1 insertion(+), 3 deletions(-)

boroo@homework MINGW64 /d/Projects/Python.Projects/maths (branch1)
$ git push
fatal: The current branch branch1 has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin branch1


boroo@homework MINGW64 /d/Projects/Python.Projects/maths (branch1)
$ git push --set-upstream origin branch1
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 281 bytes | 281.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote:
remote: Create pull request for branch1:
remote:   https://bitbucket.org/maths-team/maths-repo/pull-requests/new?source=branch1&t=1
remote:
To https://bitbucket.org/maths-team/maths-repo.git
   221deea..f493b16  branch1 -> branch1
Branch 'branch1' set up to track remote branch 'branch1' from 'origin'.

added or changed files push to bitbucket repository

boroo@homework MINGW64 /d/Projects/Python.Projects/maths (master)
$ git add init_bitbucket_repo_example.txt

boroo@homework MINGW64 /d/Projects/Python.Projects/maths (master)
$ git commit -m 'add one txt file'
[master d739c57] add one txt file
 1 file changed, 27 insertions(+)
 create mode 100644 init_bitbucket_repo_example.txt

boroo@homework MINGW64 /d/Projects/Python.Projects/maths (master)
$ git push --set-upstream origin master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 737 bytes | 737.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://bitbucket.org/maths-team/maths-repo.git
   2b33be7..d739c57  master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.

boroo@homework MINGW64 /d/Projects/Python.Projects/maths (master)
$ git commit -m 'change main'
[master 221deea] change main
 2 files changed, 210 insertions(+), 1 deletion(-)
 create mode 100644 .vscode/launch.json

boroo@homework MINGW64 /d/Projects/Python.Projects/maths (master)
$ git push
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 1.27 KiB | 1.27 MiB/s, done.
Total 5 (delta 1), reused 0 (delta 0)
To https://bitbucket.org/maths-team/maths-repo.git
   d739c57..221deea  master -> master

boroo@homework MINGW64 /d/Projects/Python.Projects/maths (master)
$

first time push my vscode project into empty bitbucket repository using bash command

boroo@homework MINGW64 /d/Projects/Python.Projects/maths
$ git init
Initialized empty Git repository in D:/Projects/Python.Projects/maths/.git/

boroo@homework MINGW64 /d/Projects/Python.Projects/maths (master)
$ git add *

boroo@homework MINGW64 /d/Projects/Python.Projects/maths (master)
$ git commit -m "Initial Commit"
[master (root-commit) 2b33be7] Initial Commit
 1 file changed, 9 insertions(+)
 create mode 100644 main.py

boroo@homework MINGW64 /d/Projects/Python.Projects/maths (master)
$ git remote add origin https://boroobaldka@bitbucket.org/m
aths-team/maths-repo.git

boroo@homework MINGW64 /d/Projects/Python.Projects/maths (master)$ git push -u origin master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 293 bytes | 293.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)To https://bitbucket.org/maths-team/maths-repo.git
 * [new branch]      master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.
boroo@homework MINGW64 /d/Projects/Python.Projects/maths (master)
$

Monday, January 8, 2018

python dictionary datatypes features

x = {1:2, 'hello': 'boroo'}
print x

y = 'world'
x.update({'x':y})
x['y'] = 'yeald'
print x['x']
print x