3 ms·
Give him some prescriptive formulas. He can look up the magic incantation for each task he needs to do. Deeper understanding of git can happen gradually. For n
by foobarbaz33 3y ago
Give him some prescriptive formulas. He can look up the magic incantation for each task he needs to do.
Deeper understanding of git can happen gradually. For now he just needs to be able to do a basic workflow.
################################
# download a new project to local disk
cd ~/projects
git clone someUrl
################################
# get latest code
git pull
################################
# observe the general state of things.
# Run status liberally, before/after any git operation.
git status
################################
# commit changes and push them up the the server.
# This is the bread an butter of your git usage.
git add .
git commit
# good idea to pull in the latest changes before you push up.
git pull
git push
################################
# resolve merge conflicts after a pull
git pull
# alert merge conflicts! git status will tell you which files conflict.
git status
# edit each file with conflicts. Conflicts are flagged in file with ">>>>"
# replace the ">>>>" sections with the final resolved code.
# now check them in and push up the the server.
git add .
git commit
git push
################################
# develop in a feature branch
git checkout -b featureX
# make changes like nomral. add, commit your changes.
# if this is a private branch on your local box only, you do not push.
git add .
git commit
# periodically pull in the code from the parent branch so you don't drift apart
git fetch origin
git rebase origin/master
# feature complete. Merge feature back to master.
git checkout master
git pull # get latest master code
git merge featureX
git push
- akg_67 3y ago+1 Prescriptive workflow approach is the best. I am not competent with git, and this is the approach I have taken. I keep note of frequently used commands and solution to frequently encountered problems. I have gone through multiple tutorials from AWS CodeCommit, GitHub, etc but the most helpful has been describing the problem to someone more knowledgeable and have them guide me. Someday git will make sense to me but it is not going to be today or anytime soon. Telling someone to take a course or go through a tutorial or read a book doesn't help that much, actually it is more discouraging and give impressions of an unhelpful colleague, as a new guy. Depending on GUI or Built-in IDE git features are not the solution, getting to know simple raw native git commands for tasks at hand or problem being faced is the best approach, imo.
- diavelguru 3y ago+1
- hnjst 3y agoOn the contrary, I'd start without any remote.