In Git, we can switch between branches with ease in the same working directory without the worry of overwriting changes made in the current branch. Don’t worry the changes made in the feature branch is safe in the remote repo. Now go back to GitTestMain.java and you will see that the change you had made in the feature branch has disappeared because SmartGit has replaced the file with the one in the master branch which is the branch we switched to in step 7. In the dialog box that pops up select ‘master’ and click ‘Switch’.Ĩ. Click on the ‘Switch’ icon on the tool bar. In the ‘Changes’ pane it will show the latest change that has been made in the feature branch.ħ. Here you will see two lines and the first line will be ‘feature’ with a green triangle besides it which denotes that this is our current branch. ![]() Select GitTestMain.java and click on the ‘Log’ button in the top toolbar to bring up the ‘Log’ window. This will show all unchanged files in the ‘Files’ pane. ![]() Press ‘Ctrl + 1’ or click on the 3rd last button from the right on the toolbar just below the ‘Main’ button. This is because the commit we made in step 3 has been pushed to the remote repo in step 4.Ħ. Now lets go back to SmartGit and look at the ‘Log’ window. You will see two branches one ‘master’ and another named ‘feature’. Open a browser and go to your github repository created in the previous post (In our example, ) and click on the branch drop down. Right click on it and select ‘Push Commits’. In the bottom left is a ‘Pushable Commits’ window. As soon as the Commit button is clicked you will see that the GitTestMain.java file is no longer displayed in the ‘Files’ pane.Ĥ. You will see in the ‘Changes’ pane SmartGit will display the change that been done. Now commit the file by selecting the GitTestMain.java file and clicking the commit button. As soon as you make any change you will see that SmartGit will highlight the file in red.ģ. Now proceed to make changes in the file GitTestMain.java. Click the button ‘Add branch and switch’Ģ. It is a prerequisite that you have followed all the steps mentioned in my previous post titled ‘Github and SmartGit’ġ. I attached some screenshot to illustrate the behavior.In this post we will play around with branches and understand how SmartGit displays version information in the Log window. Afterwards the two tags can be selected in the filtered view (without annoying scrolling in the logs) and that is really easy. In SmartGit you can search also for tags in the commit view, this means if you want to diff to tags, you just have to use a corresponding search pattern. The log view can be quite long, therefore a filtering of the log would be great.Currently you can only select a branch, then you have to select the commit in the log view and the context menu allows only the diff against the current. In SourceTree this operation is not possible. After this operation I can select a different branch and use the context menu "compare against selected commit".After this operation the corresponding the corresponding commit will be selected in the log view. In SmartGit I can select a tag or branch in the repository view and use the context menu (reveal commit) to jump to a tag or commit. ![]() I am using also SmartGit which has some features which I am missing at Sourcetree: I know that I can do this in the log view by selecting two commits with Cmd, but this is very annoying. Sometimes I have to compare different commits and branches.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |