Want to make a branch ?
git checkout
Want to make switch branches ?
git checkout
Want to get a specific file version ?
git checkout
Want to get remove changes to one file ?
Believe it or not, also
git checkout
Want to make a branch ?
git checkout
Want to make switch branches ?
git checkout
Want to get a specific file version ?
git checkout
Want to get remove changes to one file ?
Believe it or not, also
git checkout
14 Comments
great_meh@discuss.tchncs.de · 22 pts · 3y
I confess, I use switch now
Vikthor@lemmy.world · 14 pts · 3y
And there is also git restore now.
beckerist@lemmy.world · 2 pts · 3y
tdawg@lemmy.world · 14 pts · 3y
Fun fact! If you have to quickly swap between two different branches you should try:
It will swap to the previous branch you were on. Have fun!
Redscare867@lemmy.ml · 5 pts · 3y
git switch -also works for thisShustOne@lemmy.one · 8 pts · 3y
We have the best flows in the world... Because of git checkout
bappity@lemmy.world · 5 pts · 3y
only just found out how cherry picking works I love it
richard_wagner@lemmy.world · 2 pts · 3y
Nice, would you explain cherry picking to me, a dummy?
bappity@lemmy.world · 4 pts · 3y
You can copy a commit that was pushed in branch 1 and paste it to branch 2
richard_wagner@lemmy.world · 1 pts · 3y
Thanks. I wonder what effect that has on the git history of branch 2?
For some reason I thought cherry picking might be the ability to take any file from any commit on any branch and copying it to the current branch.
bappity@lemmy.world · 2 pts · 3y
the pasted commit will be at the top of the history for branch 2
BradleyUffner@lemmy.world · 1 pts · 3y
That seems like it would cause chaos if those branches were ever merged.
akincisor@sh.itjust.works · 6 pts · 3y
Git's smart enough to realize it's the same commit and skip it.
Common workflow use of cherry-pick:
All this works without issue.
Dnn@lemmy.world · 3 pts · 3y
burning_beard@lemmy.world · 1 pts · 1y
This checks out!
rain_worl@lemmy.world · 0 pts · 1y
alias git to git checkout