![]() Your other option is to commit your changes or stash them before checking out the branch. If you choose the "Discard local changes" option, Git will delete your modifications. If you have unsaved modified files, you'll see a warning. If it isn't, double click master under BRANCHES to checkout the branch OR right-click and select Checkout master. ![]() It should be highlighted in SourceTree (bold with a circle). Make sure you're in your master branch first before creating a new branch. Branching with SourceTreeĪlways create a new branch from the master branch because it contains all the current files which are live on the site and have been tested. You can create a branch on or through SourceTree. Or go to the (#create-a-new-branch) section to add a new feature branch. Go to the (#add-a-remote-branch) section to get instructions for adding an existing branch to your local copy. You can delete the stash when you apply it by checking the Delete after applying or just right-click the item under the STASHES menu and delete it from there. When you go back to the branch with the stashed modifications, apply the stash to add your modifications back in. If you have changes you don't want to commit yet but you need to checkout another branch, you can stash the files first, then switch branches. Stashing files is temporarily removing or hiding the files for later without committing them. ![]() Untracked files (purple icons with a question mark) are ok.commit any modified files or temporarily remove them by using the stash option.Make sure you don't have any modified files (yellow icon with ellipsis).When switching between branches, here are a few things to note: These branches are separate from other branches and the master branch. If you're in the about-page-revisions you will not see the new interview and vice versa. Pearl-chen - you added an interview in this branch For example:Ībout-page-revisions - you made a change to the about page in this branch Your local files will show the current status of that current branch. In Git, to checkout a branch means to switch over to that branch. Or name it after the feature you're working on like dev-updates or about-page-revisions.Īlways create a new branch from master because it contains all the current files which are live on the site and have been tested. Give your branch a descriptive name like firstname-lastname for interviews. You can even work with other team members and collaborate on the same branch. This will give you a separate area to work in and test your updates before it goes live. new interview, new page, content revisions). Instead, create a branch for each new feature (e.g. Do not add updates directly to the master branch. IMPORTANT: For the Women&Tech site, any commits added to the master branch are automatically pushed live to the site. The master branch contains all of the production ready files and code and has been tested. This is generally considered to be the clean copy or the "good copy". If you'd like an overview of how the Github workflow works, in general, check out this guide.Įvery Git repository has a master branch by default. You can name it anything you want in the Name field or just leave it the same as the repo name.īelow are specific instructions for getting the latest files, working with branches, adding content and pushing your changes to the Women&Tech site, using SourceTree. Select the button with the ellipsis to change the destination path. Select a Destination Path for your local copy. If you're not sure how your account is authenticated, use the HTTPS URL.īack in SourceTree, select File > New from the main menu. ![]() This will either be the SSH or HTTPS URL, depending on how you authenticate to GitHub. If you have already cloned the repo, skip to the Working with branches section.įrom the main repository page, select the Clone or download button and copy the URL. Cloning the repo will grab the latest files from the Github repository and save it to your computer. You can view more details in the Atlassian getting started guide. You may also be prompted to create a Bitbucket account (another Atlassian product) but it is not required. You will be required to create a (free) Atlassian account (the creators of SourceTree). Table of contentsįollow the installation steps and connect it to your Github account. If you want to work with SourceTree, follow the instructions below. Just be sure to follow the same branching workflow as the rest of the team and do not commit any files into the repo that are only required for your tool (e.g. If you are experienced with Git, use any tool or software you want.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |