💾 Archived View for gluonspace.com › gemlog › git_cheat_sheet.gmi captured on 2023-04-19 at 22:45:38. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2022-03-01)
-=-=-=-=-=-=-
I'm a lazy coder who doesn't always use version control. When I do, it's almost always Git, but I struggle to remember beyond the most basic commands. This then invariably leads me into googling something like "git cheat sheet" and scroll through some complex looking html layout of a blog post someone created. Now that I've embraced Gemini, I've created a little cheat sheet for future reference. I'll keep updating it, so feel free to bookmark it:
Meanwhile, I've included the current version down below...
git config --global user.name "first_name last_name" git config --global user.email "email"
git clone path_to_repo
git add file_name git commit [-m "message"]
or
git commit -a [-m "message"]
cd folder git init git add . git commit
Navigate to the target repo and on the top-right corner click fork.
Navigate to your fork of the repo and copy the clone URL.
git clone https://github.com/your_username/repo.git
Navigate to the target repo and copy the clone URL.
cd fork_folder git remote -v git remote add upstream https://github.com/fork_username/repo.git git remote -v git fetch upstream git checkout master git merge upstream/master
git branch branch-name git checkout branch-name
or
git checkout -b branch-name