How to Pull, Push and Commit with Git

  1. The first thing you need to do is open a ‘Terminal’ window.
    • On Mac: You can do this by searching for ‘Terminal’ in the spotlight search.
    • On windows use PuTTy
  2. SSH into the relevant server – development or production
    • Local
    • Production (this is not the real port number – you will be given this seperately)
  3. Change directory to the theme/repository that you are wanting to commit. eg.
  4. Git add (this also removes any deleted files from the repository)
  5. Commit with a descriptive and meaningful message, and using the author flag tags this commit with your specific username – this can sometimes give an error – try it and see.
  6.  Push the commit to the relevant branch of the repository. Mostly this is “master”

Pushing to a branch

If you are working on a branch of repository you will want to push to that branch and not to master.

Here’s how to do this – assuming your branch is “branchname”. Obviously your should substitute the actual branch name in to this command:

  1. Git add and commit as above

For example – pushing to the tsbi2015 branch:

 

If you get a successful push then all is well in the world. If you get an error that you are behind master then:

  1. Doublecheck you are pushing to the correct branch of the repository
  2. If you are on the right branch, then:
    1. pull, merge,
    2. resolve any conflicts
    3. then push again.

Articles in this section

Like what you see?

Find out how we can build a champion website for you.

Call Nuttify today 1300 688 4391300 688 439
or send us a message
No comments yet.

Leave a Reply