Facing problem on pushing and pulling code using terminal

Sometimes I am facing problem on pushing and pulling code using terminal. 

Please explain correct way  how to push and pull code. if you have tutorial on Pushing please provide me. Please explain step by step  I am in MAC environment 

1 answer

0 votes

Can you be more specific about the kinds of problems you experience while pushing and pulling?

I am following this way to push and pull code from master 

1)  Go to current project directory using command      cd.  <Current project directory >

 2)   Always do changes in Branch then Create new branch before you start work

3 ) Check we are in which branch     git branch 
     Create branch for modification.    git checkout -b <NEW_BRANCH_NAME>

4)  <Open project and start changes on XCODE >

5)   Adding new files with this command.   git add .

6)  Commit changes  with this command   git commit -am “Add comments to understandable easily” 

7) Move to master with this command  git checkout master 

8)  Pull code from master with this command   git pull

    (Condition: we  will get update code  from master otherwise it show Already up to date)

9)  Move to branch  with this command  git checkout <My_current_branch>

Here we are  getting two condition 

9.a) we got some update code  from master  then move to  branch ,  merge and push the code 

9.b) Merge with master with this command  git merge master 

9.c) Push our  code to branch with command git push -u origin  <My_current_branch>

 

 

 

(OR)

9.a) we did not get update code  from master. Our data is Already up to date move to branch and push 
9.b) Push our code to branch Git push -u origin <My_current_branch>

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

630 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot