Introduction

If you are the first in your team, then create the Git repository and share it with the other team members, otherwise just skip to install Git for Windows and install the Git command line tools and Git graphical tool GitKraken. The Atom code editor is a modern text editor with many extensions for Docker file syntax highlighting, PowerSheel shortcuts and much more.  After following the steps below, read how to install Docker for Windows.

create git repository

Use a Git based repository to share code and other files, with your team members. I normally use or create a free BitBucket or GitHub account.

To create a private repository go to BitBucket.org and create an account:

bitbucket_1_create_account
In your mail box, press “Verify my email address” to confirm the account creation.

bitbucket_2_verify_email

 

Now select a unique username for your BitBucket account:

bitbucket_3_choose_account_name

Once the BitBucket account is created, you can change settings and for example define your accounts website.

bitbucket_4_account_settings

To start working with your team create a private repository called “private”.

bitbucket_5_create_repository

 

Enter repository name “private”, then select “Issue tracking” and “Wiki” for project management.

bitbucket_6_create_private_repository

 

When the repository is created, we are ready to share the Git clone URL with our team members.
bitbucket_7_private_repository_created

install git for windows

Download and install Git for Windows with default settings:
https://git-scm.com/download/win 

git_1_windows_install

install gitkraken

Many developers prefer using git command line interface (CLI) tools, but for bigger projects a graphical user interface like GitKraken has many advantages.

Download and install GitKraken and create a GitKraken account in the process.

https://www.gitkraken.com/download/windows64

gitkraken_1_install_create_account

 

In GitKraken “File” menu, under “Preferences”, “Authentication”, press BitBucket.org and connect to your BitBucket account. Now press the “Generate SSH key and copy to clipboard”, to make a SSH key instead of using password each time.
gitkraken_2_connect_bitbucket_ssh_key

 

Login to your BitBucket account and under Settings, SSH keys, press “Add key” and write “GitKraken” and paste the copied SSHkey and press add.
gitkraken_3_add_bitbucket_ssh_key

 

In GitKraken under “Preferences”, we can now make a local work copy (clone) of the private repository. Select the local folder like “C:\Data\Git\lisbergio” and the private repository.

 

gitkraken_4_clone_private_repository

 

You are now ready to test your new repository by adding new or modifying existing files. When new files are added in your local work folder “C:\Data\Git\lisbergio\private”, then GitKraken will offer to view changes and you can create (stage) new files or accept changes to existing files (commit). Remember to add a summary or description to make it easier for others and yourself to know what was changed.

gitkraken_5_add_new_files

 

After new files and changes to existing files are committed to your local repository copy, you must “Push” them to the shared BitBucket private repository for your team members to see them.

At least each day before you start working you must “Pull” any changes other team members have made. If there are any conflicts with your local and the shared code, these must be resolved.

 

To avoid conflicts when you push your changes to the shared BitBucket repository, it’s a good idea to first “Stash” your local changes, “Pull” the latest changes and then “Pop” your stashed changes, so they are merged with the latest code. If everything still works, then you most likely will be able to “Push” your changes, without any conflicts.

Install atom editor

For editing code a modern code editor like Atom is a great choice.

Download and install Atom from https://atom.io

atom_1_install_code_editor

When installed press the Windows icon in the lower left corner (or Windows key) and type “cmd”, then right click and press “Run as administrator”.

Change directory by writing “cd C:\Data\Git\lisbergio\private\” and then type “atom .” to open the Atom code editor in the current folder.

toogle git tab in atom editor

Under packages, GitHub there is a menu to Toogle Git tab.

atom_2_toggle_git_tab

install atom packages

Under the “File”, “Settings” menu, you can choose “Install” to search for new packages that extent the Atom editor, like “language-docker” for Docker syntax highlighting.

The package “atom-terminal-powersheel”, makes it easy to start a PowerSheel with the short cut keys Alt+Shift+T in Atom.
atom_3_plugins

If you want to start an administrator PowerSheel, you must create a bin folder in your project with a file named “runas.vbs” containing:

CreateObject(“Shell.Application”).ShellExecute WScript.Arguments.Item(0), WScript.Arguments.Item(1) & ” -Command cd ” & CreateObject(“Scripting.FileSystemObject”).GetAbsolutePathName(“.”), “”, “runas”, 1

In the “atom-terminal-powersheel” settings change the default values of app and args:

App: 
cscript

Args: 
bin\runas.vbs “%APPDATA%\Microsoft\Windows\Start Menu\Programs\Windows PowerShell\Windows PowerShell”

Create desktop shortcuts

command prompt shortcut

You can also just create a shortcut on the Windows desktop to:

%SystemRoot%\System32\cmd.exe /K cd C:\Data\Git\lisbergio\private\

and under Advanced shortcut properties, select the check mark “Run as Administrator”.

powershell shortcut

If you prefer using the more advanced sheel and scripting environment PowerSheel, then create a shortcut on the Windows desktop to:

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -NoExit -Command cd C:\Data\Git\lisbergio\private\

and under Advanced shortcut properties, select the check mark “Run as Administrator”.