├── Resources ├── BestPractices │ ├── README.md │ └── BinaryFiles.md ├── README.md └── SolutionsCommonIssues │ ├── README.md │ ├── ContributeWithoutWritePermission.md │ └── EditsInDropBoxClone.md ├── CONTRIBUTING.md ├── LICENSE └── README.md /Resources/BestPractices/README.md: -------------------------------------------------------------------------------- 1 | # Best Practice Folder Table of content 2 | 3 | This folder includes tutorials of best practices in relation to combining GitHub and DropBox. 4 | 5 | * [Using DropBox for Binary Files](BinaryFiles.md) 6 | 7 | Feel free to add to any of the files linked to above, and add new files and link to them if you have new best practices not discussed yet. 8 | -------------------------------------------------------------------------------- /Resources/README.md: -------------------------------------------------------------------------------- 1 | # Resources folder 2 | This folder includes short tutorials that helps you with topics related to the topic in the [main tutorial](../README.md). This folder is organized into the following sub-folders: 3 | 4 | * [Best Practices](BestPractices) - Advice one how you can make the most out of this set-up 5 | * [Solution to Common Issues](SolutionsCommonIssues) - Advice one how to solve special cases that someone already has encountered and found a solution to. 6 | -------------------------------------------------------------------------------- /Resources/BestPractices/BinaryFiles.md: -------------------------------------------------------------------------------- 1 | ## Share data files and other binary files over DropBox instead of GitHub 2 | This best practice will be added to later with code example etc. 3 | * Binary files not efficient to share over GitHub. 4 | * If everyone with access to the GitHub also have access to the DropBox, then binary files can be read and saved directly to the DropBox folder and be ignored from the GitHub repository all together 5 | * Then ignore all binary files in GitHub. 6 | 7 | This solution only uses GitHub for what GitHub is best at and uses DropBox does everything else 8 | -------------------------------------------------------------------------------- /Resources/SolutionsCommonIssues/README.md: -------------------------------------------------------------------------------- 1 | # Solution Common Issues Folder Table of Content 2 | 3 | This folder includes tutorials of solutions to issues that other users have experienced when combining GitHub and DropBox. 4 | 5 | * Solutions to errors when setting up Git Bash 6 | * [Dealing with edits made to code in DropBox folder clone](EditsInDropBoxClone.md) 7 | * [Contributing to someone's repo where you do not have write access](ContributeWithoutWritePermission.md) 8 | 9 | Feel free to add to any of the files linked to above, and add new files and link to them if you have new solutions to issues not addressed yet. 10 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute: 2 | If you are familiar with how GitHub works, please feel free to make a fork and submit a pull request for any additions you want to make. Skip to the [Pull-request contributions](#pull-request-contributions) if you are familiar with GitHub and want to do this. 3 | 4 | ## Bug reports and feature requests 5 | An easy but still very efficient way to provide any feedback to this tutorial that does not require any GitHub knowledge is to create an *issue*. You can read *issues* submitted by other users or create a new *issue* [here](https://github.com/kbjarkefur/GitHubDropBox/issues). While the word *issue* has a negative connotation outside GitHub, it can be used for any kind of feedback. Please read already existing *issues* to check whether someone else has made the same suggestion or reported the same error before creating a new *issue*. 6 | 7 | # Pull-request contributions 8 | In addition to using common GitHub practices, please follow these conventions to make it possible to keep an overview of the progress made to the code in this toolkit. 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Kristoffer Bjärkefur 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Resources/SolutionsCommonIssues/ContributeWithoutWritePermission.md: -------------------------------------------------------------------------------- 1 | # Contributing to someone else's repository 2 | You can always clone someone else's repository if you can see it on GitHub.com, so you could end up in the situation where you have a clone of someone else's repository that you have made contributions to that you would like to share. You can clone these repositories using both Git Bash or GitHub Desktop, and you can use either of those tools to keep pulling updates made to those repositories, even if you do not have write permissions. 3 | 4 | However, you can only push to them if you have been added as a collaborator and have been given writing privileges. Not that you may have writing privileges but the branch you are trying to push to might be locked for edits so that only the owner can edit that branch. You can sill go through all steps of adding and committing files, but when you try to push to the cloud you will get an error. 5 | 6 | If you have made changes in your local clone that you do not have write privileges, but you still want your edits to be included, here are some suggested solutions. 7 | 8 | ## Be added as a collaborator to the repository 9 | If you know the owner of the repository, the by far easiest solution is to ask the owner if you can be added as a collaborator to the repository. 10 | 11 | ## If you can't be added as a collaborator, fork the repository 12 | Your best option if you cannot be added as a collaborator but still want to submit your edits to the original repository is to create a fork. Start by forking the original repository on GitHub.com. Since you created this fork and are the owner of the fork, you will have writing privileges to it. While you now have writing privileges to your fork, your local clone still points towards the original repository. The easiest solution is to create second local clone, transfer the changes that you did in the first clone to the second clone and push from there to your clone. When you have pushed your changes to your fork, then you can create a pull request to the original repository suggesting the edits that you did. 13 | 14 | There are complicated and technical solutions to how you can change your local clone be associated with your fork and not the original repository so you do not need to manually transfer your changes, but that is outside of the scope of this tutorial. 15 | -------------------------------------------------------------------------------- /Resources/SolutionsCommonIssues/EditsInDropBoxClone.md: -------------------------------------------------------------------------------- 1 | # Manual edits to the code in the DropBox folders 2 | While the intended work flow is that edits to the code should only be done in the non-synced folder and pushed to the DropBox folder through the GitHub cloud, it is easy to imagine that it could happen some time. To test whether there has been any edits been done in the DropBox folder to the code, you can type `git status` in Git Bash. 3 | 4 | If there are no edits made to the code you will get an output similar to the output below. The important part is that it is saying _**nothing to commit**_. 5 | 6 | ``` 7 | On branch master 8 | Your branch is up-to-date with 'origin/master'. 9 | 10 | nothing to commit, working tree clean 11 | ``` 12 | 13 | If changes were made you will get an output similar to below. The important part is _**Changes not staged for commit**_ but the rest of the output is also helpful indicating which files are edited and suggests two solutions. 14 | 15 | ``` 16 | On branch master 17 | Your branch is up-to-date with 'origin/master'. 18 | 19 | Changes not staged for commit: 20 | (use "git add ..." to update what will be committed) 21 | (use "git checkout -- ..." to discard changes in working directory) 22 | 23 | modified: 24 | 25 | no changes added to commit (use "git add" and/or "git commit -a") 26 | ``` 27 | Which solution you want depends on what you want to do and is described in the following sections. 28 | 29 | ## Discard all edits in the DropBox folder 30 | This can be done if you accidentally made a few changes here, and prefer to do manually transfer the edits to the non-synced clone instead, and add them to GitHub using the intended work flow. This will also be the desired solution if the edits was a complete mistake 31 | 32 | ``` 33 | git checkout -- 34 | ``` 35 | Test `git status` again to make sure that there are no more unresolved edits in the DropBox folder. 36 | 37 | ## Commit edits in the DropBox folder 38 | This should be done if you want to keep the edits done, and it is unfeasible or impractical to manually transfer the edits to the non-synced folder and commit them from there, which is the preferable solution, see above. 39 | 40 | To commit an edit from the console to the repository in the cloud, you should start by telling Git Bash you want to commit these changes. You do that with the following code that should be repeated for each file you want to commit. You can use wild cards in file names to include multiple files, i.e. write `file*.do` to include both `file1.do` and `file2.do` from that folder. Note that you should only add the files you want to include in the same commit here. The GitHub Desktop equivalence to this step is to tick/untick files in the list of changed files. IF you want to split up the edits in multiple commits, then do the next step before adding more files. 41 | 42 | ``` 43 | git add 44 | ``` 45 | The next step is to commit the changes. It will take all files currently selected with `git add` but not yet committed. You always have to add a commit message, so update the string in the code below before using this. This is the same message you write in GitHub Desktop. Not that the last step is required to send anything to the cloud. 46 | 47 | ``` 48 | git commit -m "Commit message" 49 | ``` 50 | 51 | So far nothing have been sent to the repository in the cloud. To do so you have to `git push` your commits. You can _push_ multiple commits at the same time, but it is perfectly fine to push one commit at the time. To push the commits you have made, simply use the code below: 52 | 53 | ``` 54 | git push 55 | ``` 56 | 57 | If it was successful you should see an output similar to 58 | 59 | ``` 60 | Delta compression using up to 4 threads. 61 | Compressing objects: 100% (7/7), done. 62 | Writing objects: 100% (7/7), 728 bytes | 728.00 KiB/s, done. 63 | Total 7 (delta 3), reused 0 (delta 0) 64 | remote: Resolving deltas: 100% (3/3), completed with 3 local objects. 65 | To https://github.com/kbjarkefur/DropBoxGitHub.git 66 | 62276bf..2329d3a master -> master 67 | ``` 68 | 69 | Test `git status` again to make sure that there are no more unresolved edits in the DropBox folder. 70 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tutorial on how to combine GitHub and DropBox 2 | 3 | #### Contributions to the tutorial is very welcomed! 4 | We greatly appreciate any type of feedback or contribution to this repository. Either open an [issue](https://github.com/kbjarkefur/GitHubDropBox/issues) if you have a comment/suggestion/bug you want to draw our attention to, or create a fork and submit a pull request if you want to edit language, improve how something is explained, or add to the common issue solutions or best practices in the [Resources](Resources) folder. See [CONTRIBUTING](CONTRIBUTING.md) for more details. 5 | 6 | ### Introduction 7 | For good or for bad, in research we often want to use both DropBox and GitHub. Usually the DropBox folder include many folders in addition to the data folder - the folder with files relevant to GitHub. The other folders have files like budget excel sheets, concept notes, contracts with survey firms etc. This tutorial is tested on DropBox but should work just as well on Box, OneDrive or any other syncing service. 8 | 9 | The reason this is an issue is that both DropBox and GitHub are services that syncs files, although in very different ways. If one person makes an edit in a file synced both by DropBox and GitHub, then DropBox will sync that file immediately, and GitHub Desktop on any other user's computer will think that this edit was done by that user as well, and all users are then asked by their GitHub Desktop to commit and sync this edit regardless of which user actually made the edit. This will lead to a lot of conflicts in the repository. While conflicts can be solved, an even bigger issue is that two users cannot work on different branches at the same time if they work from a repository shared using DropBox, since if one user change branch, then DropBox will change the folder to that branch for all users. 10 | 11 | ##### Technically simplest but often not a preferred solution 12 | The simplest solution from a strict technical perspective would be to keep the data work repository separated from the DropBox folder. This is usually not an acceptable solution to most research project teams as there will be researchers on the project that does not know GitHub and needs to be able to access the latest version of the data work files. 13 | 14 | ##### The solution recommended in this tutorial 15 | The set-up in this tutorial requires everyone who contributes to the code using GitHub to set up a clone of the repository in a local folder on their computer that is **not** the DropBox folder. One person in the team then follows the instructions in this tutorial and sets up a second local clone in the DropBox folder. DropBox will then sync this clone to everyone who is on that DropBox folder. 16 | 17 | Then team members make commits to their non-synced clone and push them to GitHub.com just like in any other GitHub collaboration. Then, at any time of your choice, you can download any new changes in the repository in GitHub.com to the DropBox clone. Each time new changes are downloaded to the DropBox clone, DropBox share them with everyone in the DropBox folder. 18 | 19 | The only catch is that GitHub Desktop can only work with one local clone of each repository at the time, so you will have to use the command line to manage the DropBox clone. We know that not everyone is used to working with the command line but providing easy to follow instructions to that is exactly what this tutorial is all about. We have boiled it down so in addition to navigate folders using the `cd` command, you only need to use one command line command `git clone` when setting up your second clone, and one command line command `git pull` when you download new edits to the repository. And all of this will be explained in great detail. 20 | 21 | ##### Other Solutions 22 | Git offers several other ways to do this. We have seen tutorials describing ways to push directly to the DropBox clone from the other clone, use webhooks to automatize some steps, etc., but we recommend the method described in this tutorial as it is the least complicated method that is still relatively easy to set up using the command line. 23 | 24 | ### Warnings 25 | 26 | This section list warnings or drawbacks of this solution. In most cases these warnings do not matter, but please read them before implementing this solution. 27 | 28 | * It will be possible to re-create all branches and all history of all branches of the repository using information stored in the .git folder (usually hidden) that is created when you create the clone. So anyone who has access to the DropBox folder with the clone will have access to the whole history of the repository, not just the files that is currently shown in the DropBox folder. It is not straightforward how to access this information (but perfectly possible), and in most projects all members allowed access to the DropBox folder also have access to the GitHub repository, so it usually not an issue, but keep this in mind when publishing your work. 29 | 30 | * Binary files (images, pdf, all Microsoft office files etc.) whose history is inefficiently stored by GitHub risk making the DropBox folder very large if those files are edited frequently. This could slow down the sync, especially on a slow connection. The solution to this is to not save binary files in the repository -- more on that [here](Resources/BestPractices/BinaryFiles.md). 31 | 32 | ### Requirements 33 | 34 | This method requires that you use the command line (the default command line interface in Windows is called the _Command Prompt_ and it is called _Terminal_ on a Mac). We understand that many people in econ research may not have a lot of experience using the command line, but we will explain all steps needed in detail. 35 | 36 | Unless you are already experienced in using the command line and have your own favorite console, we recommend that you use Git Bash instead of any of the default command line mentioned above. If you use any other command line than Git Bash you will have to install _git_ on that console. Git Bash comes with _git_ that we will need and that's why we recommend it. Each time we say Git Bash in this tutorial you could technically use any command line interface of your choice. 37 | 38 | You can download Git Bash [here](https://git-scm.com/downloads). Follow the instructions in the installer and accept the default values of all the options. If you run in to any problems when installing Git Bash, Google the error code and you are likely to find a response. Please open up an issue to this repository if you find some instructions that you think others will benefit from and that you are willing to share and we might add it to the [Resources](Resources) folder. You may also fork this repository and submit a pull-request with those addition to the Resources folder yourself. 39 | 40 | To check that _git_ is properly installed in the command line interface you intend to use is correctly set up for what you will do in this tutorial, enter `git --version` in your console and if you get an output on any of the formats you are good to go! 41 | 42 | ``` 43 | git version 2.14.2.windows.2 44 | ``` 45 | If you are using a Mac or a Linux computer you result will look different but more or less similar. If you get the answer `bash: git: command not found`, or something like that, your installation of _git_ was not successful. 46 | 47 | ##### Advice using Git bash 48 | * You change folder in the command line using the command `cd`. For example, `cd "C:/Program Files"` changes the working directory to the folder _C:/Program Files_. 49 | * Git Bash uses both relative and absolute file paths. That means if you are already in folder _C:/Users/Researcher_ and want to go to _C:/Users/Researcher/DropBox_ you can either type the full file path `cd "C:/Users/Researcher/DropBox"` or just the relative file path `cd "DropBox"` as you are already in the _C:/Users/ResearcherResearcher_ folder, and you only need to enter the file path relative to the folder that you are in. Relative file paths are important as Git Bash almost only use relative file paths in its output. 50 | * Git Bash requires you to use forward slashes. So `cd "/Dropbox/ProjectFolder/RepositoryName"` works but `cd "\Dropbox\ProjectFolder\RepositoryName"` does not. 51 | * File paths must be enclosed in quotation marks if there is a space in any of the folders or file names. It is good practice to always do so. 52 | * To paste something in Git Bash, use `shift+insert` instead of `ctrl+v`. You can also right click and select paste. 53 | * The `~` (tilde) is a short hand for your user folder on your computer. As in _C:/Users/Researcher_ in Windows or _/Users/Researcher_ on a Mac where _Researcher_ in both cases is replaced with the user name you are logged in as on your computer. Test this by typing `cd ~` which change your working directory to the user folder, and afterwards type `pwd` to display your user folder. 54 | 55 | # Initial Set-Up 56 | After you have your console working and have _git_ installed on it (see the [requirements](#requirements) section above if you have note done this), you can start following these steps to set up your non-synced repository clone and your DropBox Folder Clone. 57 | 58 | This part you only need to do once for each project. Skip to [update DropBox](#update-dropbox-clone) if you have already cloned your repository in the DropBox folder and you only want to download new changes made in or committed to the repository at GitHub.com. 59 | 60 | ### Create GitHub Repo and DropBox folder 61 | Start by creating a GitHub repository and a DropBox folder for your project. You may use a GitHub repository and a DropBox folder that you already have, but the content of the repository may not already be in the DropBox folder. In this tutorial the repository will be called _DropBoxGitHub_ and the DropBox project folder will be called _ProjectFolder_ and its local location is _C:/Users/Researcher/Dropbox/ProjectFolder_. But you can call your repository or project folder anything you want, and your DropBox fodler might be in a different location. 62 | 63 | We strongly recommend you to use a .gitignore file that ignores everything but code files. Use for example World Bank DIME's [.gitignore template](https://github.com/worldbank/DIMEwiki/blob/master/Topics/GitHub/gitignore_template.txt) that is developed to suit what researchers in economics usually needs. 64 | 65 | # Create the clones 66 | 67 | ### Create a Non-synced clone 68 | This should be done by each team member that will contribute to the code. Clone the repository to your computer using GitHub Desktop. Do **NOT** clone the repo to a folder in your DropBox folder (a second clone will be created in the DropBox folder next). Clone the repository to, for example, _C:/Users/Researcher/Documents/GitHub_. 69 | 70 | ### Create a Synced Clone in the DropBox folder 71 | The DropBox clone will be synced by DropBox to all team members sharing the DropBox folder so this should only one project team member needs to do this. GitHub Desktop can not be used to create a second clone in a different location. Therefore, in the next steps we will have to use the command line to create a second clone of the repo in the DropBox folder. 72 | 73 | ##### Navigate to the DropBox folder for the clone 74 | Start by preparing a location for the cloned repository in the DropBox folder you created above. Note that a folder with the same name as the repository will be created in the location that you choose, and all the content of the repository will be cloned into that folder. You may rename this folder once it is created. 75 | 76 | Open Git Bash and navigate to the location in the DropBox folder you prepared. Do this using the command _cd_ followed by the file path to where in the DropBox Folder you want to create the Data Folder. Remember that in Git Bash you must use forward slashes _/_. Like this: 77 | 78 | ``` 79 | cd "C:/Users/Researcher/Dropbox/ProjectFolder" 80 | ``` 81 | 82 | In most command line interfaces you can see where you currently is navigated. In Git Bash you can see it on the line above where you enter your command. See the example below. Remember that _~_ is a short hand to the user folder (in this case _C:/Users/Researcher_) used by Git Bash. 83 | 84 | ``` 85 | username@computername ~/Dropbox/ProjectFolder 86 | $ 87 | ``` 88 | In the Command Prompt (the default command line in Windows) the current folder is shown on the same line that you enter your command on. 89 | 90 | ``` 91 | C:/Users/Researcher/Dropbox/ProjectFolder> 92 | ``` 93 | 94 | When you are in the location where you want to clone the repository, move on to the next step. 95 | 96 | ##### Clone the repository to DropBox 97 | Now when you have navigated to the location in the DropBox folder where you want to clone the repository you first need the _Clone with HTTPS_ URL for this repository. You find this URL on GitHub.com and note this is not the same as the regular URL to the repository. To get the _Clone with HTTPS_ URL, go to the main page of the repository on GitHub.com in the browser. For this repository that would be [this page](https://github.com/kbjarkefur/GitHubDropBox). Click the green button that says **Clone or Download**. Here you want to get the link for **Clone with HTTPS**. Copy the _Clone with HTTPS_ link. If it says _Clone with SSH_ click the link where it says _Use HTTPS_ and it will change to the one we need here. It is perfectly possible to also use SSH but how to do that is not covered in this tutorial. 98 | 99 | Use the code below to clone the repository into your DropBox folder, but replace the URL in the code below with your _Cloning with HTTPS_ URL. The URL in the example below works (it is this repo) and feel free to test with it. The access settings on this repository prevents you to make any changes to the repository, so feel free to experiment however you like. The code below will create a folder with the same name as the repository, but you can change the name of this folder once this command is done. It may take a few moments if the repository is big or has a long edit history. 100 | ``` 101 | git clone https://github.com/kbjarkefur/DropBoxGitHub.git 102 | ``` 103 | If it is a private repository you are cloning, you will be asked to enter your GitHub username and password unless they are already chached on your computer (either done manually or done by GitHub Desktop). Many _git_ commands require your credentials, so to get around the requirement to add your credentials each time see for example [here](https://www.tilcode.com/push-github-without-entering-username-password-windows-git-bash/). 104 | 105 | If the command ran successful you should get an output similar to this if it was successful: 106 | 107 | ``` 108 | Cloning into 'DropBoxGitHub'... 109 | remote: Counting objects: 42, done. 110 | remote: Compressing objects: 100% (31/31), done. 111 | remote: Total 42 (delta 7), reused 38 (delta 6), pack-reused 0 112 | Unpacking objects: 100% (42/42), done. 113 | ``` 114 | 115 | See on your computer how `git clone` created a new folder, with all the content of the repository in it. You now have a second clone on your computer in your DropBox to which you can download updates to the repository directly from the cloud (see next section) so that team members that use only DropBox and not GitHub, can still access the code. Remember that the recommended work flow is to not work on the code directly in the DropBox folder. Always work in the clone in a non-synced folder, push updates to the cloud from there and then pull the new edits to the DropBox folder as described in the next section. This means that everyone that work on the code should be using GitHub. It is possible to include edits made directly in the DropBox folder. This is explained [here](Resources/SolutionsCommonIssues/EditsInDropBoxClone.md) but it is not a recommended work flow as it is prone to conflicts and errors. 116 | 117 | # Update the DropBox Clone 118 | Make sure that you or someone in your team have already done the steps in the [initial setup](#initial-setup) section before doing this step. Note that it does not matter who did the set-up initially, anyone with access to the clone in the DropBox folder and git installed can do the steps described here. 119 | 120 | Each time you want to update the DropBox folder, start by navigating to the folder in Git Bash. Note that we are not navigating into the same folder as when we cloned the repository. We want to be in the folder created when we cloned the repository, i.e. _Dropbox/ProjectFolder/DropBoxGitHub_ instead of _Dropbox/ProjectFolder_. 121 | ``` 122 | cd "C:/Users/Researcher/Dropbox/ProjectFolder/DropBoxGitHub" 123 | ``` 124 | When you have navigated into the repository folder, use the command `git pull`. It will copy all updates in the repository in the cloud to your DropBox folder. There will be nothing to update if you have not made any edits to the repository in the cloud since you first created this clone. 125 | ``` 126 | git pull 127 | ``` 128 | This is all you have to do in order to sync any edits to the repository on GitHub.com to your clone in the DropBox folder. Once you have pulled the new edits to your DropBox folder, DropBox will then sync these new edits, just like it does with any type of file, to everyone else's DropBox. Note that `git pull` follows the ignore rules for this repository, and will not download any files ignored by gitignore in this repository. 129 | 130 | Note that `git pull` only updates the branch you are currently in. There are tools that pull all branches but they sometimes do more than what you want, so unless you know them well, pull one branch at the time. And since the intended work flow is to not work on the code in the DropBox folder, it is mostly only the master branch that is needed to be up to date. See the next section for details on branches. 131 | 132 | ##### Note on branches 133 | If you do not see the updates that you just pulled into you DropBox Folder, you want to make sure that you are in the right branch of the repository. In Git Bash the current branch is always listed after the current working directory. See example below. 134 | 135 | ``` 136 | username@computername ~/Dropbox/ProjectFolder/DropBoxGitHub (master) 137 | $ 138 | ``` 139 | 140 | If you are not in the branch where you want to be you can switch to a different branch using this code, but replace __ with the name of the branch you want to switch to. 141 | 142 | ``` 143 | git checkout 144 | ``` 145 | 146 | **Warning:** Note that if you change branch, git will change the files in the folder so that they reflect the files in that branch. DropBox will interpret this as if the files have changed and will then sync those changes to everyone. So if you change branch in the DropBox clone you change the branch in everyone's DropBox folder, and the repository does not change back to the master branch by itself, this has to be done manually. This will be very confusing to anyone accessing the files using DropBox, so it is probably best to avoid changing branches in the DropBox clone unless necessary. 147 | 148 | Note that you cannot change branch if you have made changes to the files in DropBox without committing them. If you get an error similar to the output below, then that means that you have un-committed changes made to the files in the DropBox folder. See [here](Resources/SolutionsCommonIssues/EditsInDropBoxClone.md) for suggested solutions. 149 | 150 | ``` 151 | error: Your local changes to the following files would be overwritten by checkout: 152 | 153 | Please commit your changes or stash them before you switch branches. 154 | Aborting 155 | ``` 156 | 157 | # Other resources in this repository 158 | 159 | * [Best Practices](Resources/BestPractices/README.md) 160 | * [Solutions to Common Issues](Resources/SolutionsCommonIssues/README.md) 161 | --------------------------------------------------------------------------------