User Tools

Site Tools


newdevs:git:test

This is an old revision of the document!


Git for Windows

Using Git to Test Patches

1. Update Your Local Repository

  1. Open Git Bash
  2. Navigate into your Evergreen repository
  3. If the master branch isn't currently checked out, check it out: git checkout master
  4. Make sure your local repository is current: git pull origin master

2. Identify the Commit ID for the Patch

Identify the unique commit identifier for the patch you wish to test. This is found by clicking on a link in the related launchpad bug, or navigating to https://git.evergreen-ils.org > working/Evergreen.git > clicking on the link under "heads", then clicking on the branch. Once there, copy the first 7+ characters from the unique commit code.

3. Create a Local Testing Branch

  1. Create and checkout a local testing branch: git checkout -b lp12345
  2. Pull changes into the testing branch using the unique commit id: git cherry-pick 7ab7281f5
  3. Test the changes on your test server.

NEED MORE INFO * If you have direct Git Bash access to your test server… Need Additional Information - how do changes get compiled? Through a git merge ? * If you do not have Git Bash access to your test server, but you have file system access to your test server through WinSCP or a similar FTP-style program, manually copy the changed files to your server for testing.

4. Create a Sign-Off Branch

If testing is not successful, update the launchpad bug report with details.

If testing is successful, acknowledge it by adding a sign-off branch:

NEED BETTER INSTRUCTIONS HERE - I still don't quite understand how to create a branch that only contains a sign-off - does it contain all the changed files AND the sign-off? Or just the sign-off?

git push working lp12345:user/my-user-name/lp12345-signoff

5. Update Launchpad

  1. In the relevant launchpad but, add the "signedoff" tag.
  2. Also, add a link in the comments to your sign-off branch.

Useful Git Bash Commands

Git Commands

  • git add myfile.txt –> stage a specific file
  • git add -A –> stage all modified files in the current directory and subdirectories
  • git add . –> (Note the period) stage all modified files in the current directory but not subdirectories
  • git branch –> list existing local branches
  • git branch mynewbranch –> create a new branch
  • git branch -m oldbranchname newbranchname –> change name of branch
  • git branch -D branchname –> delete a local branch (cannot delete a branch you currently have checked out, so switch to different branch first)
  • git checkout mybranch –> check out an existing branch
  • git checkout -b mynewbranch –> create a new branch and check it out at the same time
  • git checkout master –> switch to master branch
  • git checkout – docname.tt2 –> resets a file you've changed back to its original state (like an undo / revert changes command)
  • git clone git://git.evergreen-ils.org/Evergreen.git –> clones a remote repository
  • git commit –> invoke the default text editor to add a commit message
  • git commit -m "my commit message" –> add brief commit message instead of opening the text editor to add a commit message
  • git commit --amend --> overwrite your last commit message * git commit <nowiki>--amend --signoff –> view and amend your sign-off branch
  • git commit -a –> combine the git add and git commit steps into a single step (does not include newly created files)
  • git config --global -l –> list all global configuration values
  • git config --global keyname "value" –> create a global value
  • git fetch --all –> refresh your local cache from the remote branches (does not download new branches)
  • git help –> access the built-in Git help documentation.
  • git log --oneline –> list previous commits with their unique ids
  • git pull –> imports all updates from your default remote repo to your default local repo (usually, this is equivalent to 'git pull origin master')
  • git pull origin master –> import all updates from remote origin repo to local master repo
  • git pull --rebase origin master –> rebases (rather than merges) new remote changes to your local repository
  • git push working mybranchname –> push changes to the remote working directory
  • git push working --delete mybranchname –> delete a remote branch
  • git remote -v –> display remote directories
  • git reset HEAD myfile.txt –> unstage a file that has already been staged
  • git reset --hard –> reset a current branch to its original state
  • git rm badfile.txt –> delete a file (if the file is being tracked, be sure to add a commit message indicating the file has been deleted)
  • git show --stat –> see what your commit will look like before you push it
  • git status –> display status of current branch
  • git version –> displays the installed version of Git

Other Commands

  • cd –> move back to the home folder
  • cd foldername –> move from the current folder to a child folder
  • cd .. –> move up in the folder hierarchy one level
  • clear –> clears your command window giving you a fresh screen to work with
  • ls –> list all of the folders and files in the current folder
  • mkdir newfoldername –> create a new folder
  • notepad++ newdocname.txt –> create a new file and open it in notepad++
  • notepad++ docname.txt –> edit an existing file in notepad++
  • pwd –> see what folder you are currently in
newdevs/git/test.1561756029.txt.gz · Last modified: 2022/02/10 13:34 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.