- 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
- SSH into the relevant server – development or production
- Production (this is not the real port number – you will be given this seperately)
1ssh email@example.com -p 1234
- Change directory to the theme/repository that you are wanting to commit. eg.
- Git add (this also removes any deleted files from the repository)
Shell1git add --all
- 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.
Shell1git commit --author "Mr Big <firstname.lastname@example.org>" -m "an extremely meaningful and descriptive message that tells anyone who reads this exactly what I've done, which files I've edited, what features have been added or removed...etc"
- Push the commit to the relevant branch of the repository. Mostly this is “master”
Shell1git push origin 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:
- Git add and commit as above
Shell1git push origin HEAD:branchname
For example – pushing to the tsbi2015 branch:
nuttify@nuttifydev:~/www/the-small-business-institute$ git push origin HEAD:tsbi2015
Username for 'https://bitbucket.org': ajaxmac
Password for 'https://email@example.com':
Counting objects: 341, done.
Compressing objects: 100% (149/149), done.
Writing objects: 100% (150/150), 4.95 MiB | 17.00 KiB/s, done.
Total 150 (delta 112), reused 0 (delta 0)
* [new branch] HEAD -> tsbi2015
If you get a successful push then all is well in the world. If you get an error that you are behind master then:
- Doublecheck you are pushing to the correct branch of the repository
- If you are on the right branch, then:
- pull, merge,
- resolve any conflicts
- then push again.