👋 Hey there, I am Waylon Walker
I am a Husband, Father of two beautiful children, Senior Python Developer currently working in the Data Engineering platform space. I am a continuous learner, and sha
Great tips Anna! I really like that you include branching in your guide. So many guides just start committing right into main. In my experience, the minute that I get main broken with a crazy change, someone asks for a simple fix and I need to get my work off of main and into its own branch.
If you forget to branch
I do this often
get everything committed (you can always stash, but I like this way).
notereset --hard will lose work if you do not have it saved to another branch.
$ git status
On branch main
Your branch is ahead of 'origin/main' by 1 commit.
$ git branch long-term-feature # save your work to a branch$ git reset origin/main --hard# line up your main and remote main$ git status
On branch main
Your branch is up to date with 'origin/main'.# now checkout a new branch starting from where main is to start the quick fix$ git checkout -b quick-fix
Great addition, thanks Waylon! Yes it's tough sometimes to decide what should go into a beginner tutorial because on the one hand, you don't want to overload with too much information. On the other hand, you want to build good habits early. I'm glad you agree with the call I made on that one :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great tips Anna! I really like that you include branching in your guide. So many guides just start committing right into
main
. In my experience, the minute that I get main broken with a crazy change, someone asks for a simple fix and I need to get my work off of main and into its own branch.If you forget to branch
I do this often
get everything committed (you can always stash, but I like this way).
note
reset --hard
will lose work if you do not have it saved to another branch.Great addition, thanks Waylon! Yes it's tough sometimes to decide what should go into a beginner tutorial because on the one hand, you don't want to overload with too much information. On the other hand, you want to build good habits early. I'm glad you agree with the call I made on that one :)