watchtrio.blogg.se

Checkout in sourcetree
Checkout in sourcetree











Newbrain has solid advice, but in general if you have no unstaged changes and all commits end in a branch then you aren't actually going to lose anything, despite the warning. EtA: I don't see any connection to Github in Sourcetree, remember: Github is online service that provides git repositories and support for a way of working (the "pull requests" etc.), but they are not the same thing. branches: pointers to the tip of a path on the graph, automatically moved when a new commit is added tags: pointers to a commit, they do not move, so they are useful to friendly identify a specific commit (e.g.: "Rev1.2.3"). Each node is represented by a unique hash, but to make it simpler (eh.) for humans, we have a number of useful pointers: HEAD: a pointer to the current commit you are sitting into. As for going back and forth on the same branch: you should really learn to use branches to add new features, to test ideas etc.: they are cheap! A small takeaway, with some simplifications: git is just a way to handle acyclic directed graphs, where each node is a 'commit' = the status of your repository at a specific point in time.

checkout in sourcetree

However, the older commit is still available in the chain, and can be addressed with "HEAD^" (meaning 'the parent' of HEAD - there are a lot of fine points here, and other ways to address it, this will do for now). In this particular case, I don't see the problem (and frankly do not understand the warning, from you pictures): When you checkout Branch_test, HEAD will be moved to point to the commit Branch_test points to. Yes, branches are also pointers to commits, with the peculiarity of being tied to the "tip" of the commit chain (so they move when a new commit is introduced on that branch).

checkout in sourcetree checkout in sourcetree

Your (only?) branch Branch_test is pointing to a later commit. With that out of the way, let's see the specific case: Your "detached HEAD" is not a symptom of decapitation, but that the pointer to the checked out commit (that's what HEAD is: a pointer to a commit) is not currently associated with a branch. You might also try Oh my git!, it's a gamified tutorial, but it uses real git, and does not hide its working. In my experience, tools are helpful, but an understanding of the basic working of the tool is fundamental: for me it only 'clicked' when I stopped relying on tools (I still use the integration in VSC and its git graph extension for basic stuff), on answers on stack exchange (which helped me screw up a lot) and on dodgy tutorials. Thank youįirst, a hint: if you want to use git, invest some time going through the book. With reference to the first attached picture: 1) I went back to the commit previous to the latest as you can see on it being highlighted in bold (Description: "WORKING: But noticed the concurrent ON prints.") 2) I did not change anything (that I m aware of) while that commit is "active" 3) just now I tried clicking on the latest commit (Comment: "WORKING: Concurrent tested correctly") but when I double click on it it shows the error message in the screenshot which I don't understand the explanation of. This is the sequence of events and what happened. But did just now and when trying to get back to the latest a warning comes up.

checkout in sourcetree

I have never gone back to an older commit (i.e. I only keep adding commits and if needed then go back to the latest one ONLY. GitHub) version control only in local mode and used it only in "simple way", no branching or anything else. How can I safely checkout the latest commit while making sure none of those two (or other) commits are changed in any way? I have been using Sourcetree (i.e. Hi, Please see attached screenshot with version control warning.













Checkout in sourcetree