Categories
Programming

Git branching basic workflow

To better handle multiple people working on a project in a Git repository, using branches and reviewing pull requests before committing to the master branch is strongly suggested.


Basic steps:

  1. Change to your home directory and clone the git repository
    1. cd $HOME
    2. git clone [email protected]/MyRepo.git
  2. Change into the new project directory
    1. cd ./MyRepo
  3. Create a branch to work on the new code
    1. git checkout -b MyNewBranch
  4. Verify you are working in the branch
    1. git branch
    2. Note: The branch will have a “*” to the left of the branch name denoting the active branch
  5. Update code, test, repeat
  6. Review and add any missing files
    1. git status
    2. git add <file_name>
  7. Push the code into the repository
    1. git push –set-upstream origin MyNewBranch
      1. This is only necessary for the first ‘git push’
    2. git commit -v {list of changed files}
      • Note the response from the system:
      • remote: Create a pull request for 'MyNewBranch' on GitHub by visiting:
      • remote: https://git.repo.example.org/MyRepo/pull/new/MyNewBranch
  8. Open the pull request (PR) in git.repo.example.org
    1. Add other repository contributors to request a code review before merging.
  9. Repeat the edit/test/PR cycle as necessary until merge is accepted
    1. edit code … test … git status … git add … git commit … git push
  10. When it has been accepted, clean-up your work area:
    1. cd $HOME/MyRepo/
    2. git checkout master
    3. git pull
    4. git branch –delete MyNewBranch
  11. Celebrate on a successful pull request!
Categories
Hardware

IBM Model-M and the Windows Key

I really love my IBM Model-M keyboard, but one frustration is the more frequent need for the Windows key. Even some Linux desktops are using it. Oh I get it, it’s a handy “meta” key that helps differentiate keyboard tasks so it’s lack is annoying at times.

For the few times I am in Windows 10 using my Model-M keyboard, I found this answer on SuperUser.com to re-map the caps-lock key to the Windows key with a simple registry hack: https://superuser.com/a/1228990/101577

Just in case that link goes away, here’s the text:

Anyway, using SharpKeys I found the correct map for CAPS LOCK to Win is this:

https://superuser.com/a/1228990/101577
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,5b,e0,3a,00,00,00,00,00

Just save those lines as presented into a file, “c:\WinKeyRemap.reg”, then use File Manager to find it, then double-click to open it with the Registry Editor. (You’ll need to accept the warning.) Assuming the file is correct, Registry Editor will report that the values have been added to the registry.

Reboot to make the changes take effect.