en:uhsdr_dev:git

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:uhsdr_dev:git [13.03.2018 11:45] df9ts_useren:uhsdr_dev:git [16.03.2018 13:09] (current) – [Further reading] df9ts_user
Line 13: Line 13:
   * If using Eclipse: create a work space pointing at the local directory where UHSDR has been unpacked. Check Eclipse settings after that (active build etc.)   * If using Eclipse: create a work space pointing at the local directory where UHSDR has been unpacked. Check Eclipse settings after that (active build etc.)
    
-==== Option: Use "git" on command line level, Unix style ====+==== Option: Use "git" on command line level, command line style ==== 
 + 
 +A git cheat sheet can be found {{ :en:uhsdr_dev:git_cheat_sheet.pdf |here}} 
 + 
 +=== Fork UHSDR to your own remote github repo === 
 +  * Create github account if needed, or sign into github 
 +  * Goto https://github.com/df8oe/UHSDR and create a fork - which will be located in your github space 
 +  * Note the URL of your github fork, e.g. https://github.com/DF9TS/UHSDR-1
  
 === Pull UHSDR from Github === === Pull UHSDR from Github ===
   * If git is not intalled on your system: <code>$apt-get install git</code>   * If git is not intalled on your system: <code>$apt-get install git</code>
-  * Clone UHSDR repository:  +  * Clone UHSDR repository: Go to the directory where you want to store the GIT clone, then create a local clone. Use the URL for your github fork, e.g. <code>$git clone https://github.com/DF9TS/UHSDR-1</code> 
-    * Go to the directory where you want to store the GIT clone, then type<code>$git clone https://github.com/df8oe/UHSDR.git</code>+  * You now have a local clone of your fork in the current local directory 
 +  * Check the remote repos assigned <code>git remote -v</code> 
 +  * Add DF8OE UHSD repo as upstream remote repo so that you can esaly synch it with your fork: <code>git remote add upstream https://github.com/df8oe/UHSDR</code> 
 +  * Check with "git remote -v" that upstream has been addedYou now have two remote repos: "origin" which is your fork on github, and "upstream" which is the DF8OE master repo 
 + 
 +=== Rebase: Synchronising your fork with UHSDR DF8OE repo === 
 +  * You want to synchronise your forked UHSDR with the DF8OE main repo from time to time to include the latest changes of UHSDR into your fork. 
 +  * For that use <code> git pull --rebase upstream active-devel</code> 
 +  * Your local fork is now synchronised with UHSDR DF8OE repo 
 +  * Next you need to push these changes to your remote github repo <code>git push origin active-devel</code> 
 +  * Your github fork is now synchronised with DF8OE UHSDR main repo 
 + 
 +=== Creating branches for tests and experiments === 
 +Before creating any new branch please pull the changes from upstream as explained above. Make sure your forked repo is up to date. 
 + 
 +  * Create the branch on your local machine and switch in this branch :<code>$ git checkout -b [name_of_your_new_branch]</code> 
 +  * Change working branch : <code>$ git checkout [name_of_your_new_branch]</code> 
 +  * Push the branch from local repo onto remote github : <code>$ git push origin [name_of_your_new_branch]</code> 
 +  * When you want to commit something in your branch, be sure to be in your branch. Add -u parameter to set upstream. To check current branch use <code>$ git branch</code> 
 +  * Add a new remote for your branch : <code>$ git remote add [name_of_your_remote]</code>  
 +  * Push changes from your commit into your branch : <code>$ git push [name_of_your_new_remote] [name_of_your_branch]</code> 
 +  * Update your branch when the original branch from official repository has been updated : <code>$ git fetch [name_of_your_remote]</code> 
 +  * Then you need to apply to merge changes, if your branch is derivated from develop you need to do : <code>$ git merge [name_of_your_remote]/develop</code> 
 +  * Delete a branch on your local filesystem : <code>$ git branch -d [name_of_your_new_branch]</code> 
 +  * To force the deletion of local branch on your filesystem : <code>$ git branch -D [name_of_your_new_branch]</code> 
 +  * Delete the branch on github : <code>$ git push origin :[name_of_your_new_branch]</code>
  
 === Use local UHSDR clone in Eclipse === === Use local UHSDR clone in Eclipse ===
Line 46: Line 78:
 ==== Further reading ==== ==== Further reading ====
 https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-clone https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-clone
 +http://www.ralfebert.de/git/
 +
  
  
  • en/uhsdr_dev/git.1520941535.txt.gz
  • Last modified: 13.03.2018 11:45
  • by df9ts_user