Newbie to GIT – deploying from Github to Google Compute Engine / AWS

I am new to GIT and am still learning the basics. I have however been able to successfully create a repository at using the GUI tool and have 4 branches for my project

1. Master - default
2. Local - which is the copy of code that runs on my local machine
3. GCE - DEV - which is the copy I'd like to deploy onto my google compute engine instance

  • vimdiff is not launching when I try to resolve a git merge conflict
  • Git LFS refused to track my large files properly, until I did the following
  • How to rebase in git, forcing 'theirs' for all conflicts
  • What is $(prefix) on $(prefix)/etc/gitconfig?
  • How to add unique integer short ID (feature number) for every card in trello?
  • How to update git version from GitHub Desktop on Windows
  • Question 1 – what is the simplest way to move code from one branch to another? In other words once I test and certify code in my local branch I’d like to move it to the GCE DEV branch from where I can deploy to my server. How do I move an entire branch vs just a few files?

    Question 2 – currently I SSH into my google compute instance and then use git clone to copy over code to my folder there. Is there a better way?

    Question 3 – My folder on google compute is not added to GIT – should I add it to GIT? Or should I leave it alone and just continue to clone code into like mentioned in step #2

    Question 4 – subjective – but is this a good way to organize my code? The reason I did it this way is to ensure that I have code versions in every environment and I can track the movement of code across environments via branches in GIT

    Again – I am new to GIT so I apologize in advance if I am making fundamental errors or assumptions but help is appreciated.

  • Git push failed - unpack-objects abnormal exit
  • deploying a website/webapp via git/gitolite permissions error
  • GIT pull : replace local version with the remote version
  • git tries to delete a directory on checkout
  • Git for windows launch gitk context menu with gitk-all
  • Display url of git pull
  • One Solution collect form web for “Newbie to GIT – deploying from Github to Google Compute Engine / AWS”

    1. The way to move code from one branch to another is to merge. See Pro Git, the chapter on Basic Branching and Merging for starters.

    2. Yes, you only need to create a clone once. After you have created a clone, you can use git pull to update the files on your server.

    3. It’s unclear what you mean by “added to Git”.

    4. Branches are for tracking different paths of development, rather than for separating code between physical (different machine) boundaries. See A successful Git branching model for a description of “git flow”, which is a good way to think about branches.

    Git Baby is a git and github fan, let's start git clone.