Looking for a good Git tutorial

Solarion

Honorary Master
Joined
Nov 14, 2012
Messages
28,051
Reaction score
17,804
I've been hunting around for some extra hours work and one of my prospective clients uses GIT. Now I've only dabbled in it but it seems they pretty strict with this and wanting someone to pick up on some new programming work asap. Please could one of you suggest something that starts from basic to advanced. I want to be able to show them something promising by Tuesday next week so on a deadline here!

Edit: Not the command line version. They use the UI one.

TIA
 
Thank-you guys much appreciated. Time for lots of coffee...
 
Don’t bother with source control, just get the code right the first time!
 
using git via GUI is a complete waste of time. they are nice to bulk stage a few files in a commit, that is all.

here is the complete git masterclass :ROFL: -


Code:
git pull
git checkout -b [new-branch-name]
git checkout [branch-name]
git merge [branch-name]
git status
git diff
git add [file-name]
git commit -m "your message"
git push --set-upstream origin [branch-name]
git push

and some others which are used less frequently

Code:
git remote prune origin
git branch -d [branch-name]
git push origin :[branch-name]
 
I've been hunting around for some extra hours work and one of my prospective clients uses GIT. Now I've only dabbled in it but it seems they pretty strict with this and wanting someone to pick up on some new programming work asap. Please could one of you suggest something that starts from basic to advanced. I want to be able to show them something promising by Tuesday next week so on a deadline here!

Edit: Not the command line version. They use the UI one.

TIA
You can have a look at this to assist:

https://www.sourcetreeapp.com

Not perfect but it does the job.
 
using git via GUI is a complete waste of time. they are nice to bulk stage a few files in a commit, that is all.

here is the complete git masterclass :ROFL: -


Code:
git pull
git checkout -b [new-branch-name]
git checkout [branch-name]
git merge [branch-name]
git status
git diff
git add [file-name]
git commit -m "your message"
git push --set-upstream origin [branch-name]
git push

and some others which are used less frequently

Code:
git remote prune origin
git branch -d [branch-name]
git push origin :[branch-name]

git gud :thumbsup:
 
using git via GUI is a complete waste of time. they are nice to bulk stage a few files in a commit, that is all.

here is the complete git masterclass :ROFL: -


Code:
git pull
git checkout -b [new-branch-name]
git checkout [branch-name]
git merge [branch-name]
git status
git diff
git add [file-name]
git commit -m "your message"
git push --set-upstream origin [branch-name]
git push

and some others which are used less frequently

Code:
git remote prune origin
git branch -d [branch-name]
git push origin :[branch-name]
It depends, if you are already using an IDE with good Git integration it can't hurt to use it. Take the Intelij git integration, it works very well.
 
SourceTree on Windows is awful. Endless lock file issues. We use SourceTree. I do all my checkout, pull, push, rebasing, merging from the command line and only use SourceTree has a viewer. No such issues on OSX. Haven’t used it on Linux, but I expect it to be as well behaved as OSX.

Don’t know about GitKraken, company is too cheap to use it. ;)
 
My experience with GIT, and correct me if I'm wrong, is be very careful to properly configure your excludes and make sure you don't have any production or test settings files lying around to commit. Once you've uploaded to GitHub for example, there's no going back short of recreating the repo from scratch... That history remains.

This is a really good point. Once you have pushed something like a list of passwords to the remote and it’s merged into master, then you got problems.

However, if cloning an existing remote repo. The .gitignore file should already be properly setup.

As Daruk warns, when create new files, be careful what you put in them.
 
Regarding a good tutorial, there isn’t really a single one. Atlassian has good beginners guides as already mentioned. Download the cheat sheet from that site. Git it just too big for there to a be one good tutorial.
 
using git via GUI is a complete waste of time. they are nice to bulk stage a few files in a commit, that is all.

here is the complete git masterclass :ROFL: -


Code:
git pull
git checkout -b [new-branch-name]
git checkout [branch-name]
git merge [branch-name]
git status
git diff
git add [file-name]
git commit -m "your message"
git push --set-upstream origin [branch-name]
git push

and some others which are used less frequently

Code:
git remote prune origin
git branch -d [branch-name]
git push origin :[branch-name]

Code:
git commit --amend
git merge --squash
 
Code:
git commit --amend
git merge --squash
Tbh, why squash the commits unless it's for public repo's?
git stash is also quite useful when you don't want to commit but need to quickly fix something up in another branch.

I like doing git merges in VS Code due to the left-hand sidebar for version control:
https://code.visualstudio.com/docs/editor/versioncontrol#_git-support

Source Tree has always been quite laggy for me, plus I really only want GUI for merge conflict so that I can quickly get an overview of what's conflicting so I can quickly sort it out.


If you are using Jira: https://marketplace.atlassian.com/apps/4984/git-integration-for-jira?hosting=cloud&tab=overview and https://marketplace.visualstudio.com/items?itemName=Atlassian.atlascode
 
Tbh, why squash the commits unless it's for public repo's?

Keeps the tree clean. Only use it when guys are working on long running branches.

Team of right guys and that line is straight most of the time :p (although squash is not the reason for this, more like the last resort).
 
Keeps the tree clean. Only use it when guys are working on long running branches.

Team of right guys and that line is straight most of the time :p (although squash is not the reason for this, more like the last resort).
So basically on master? Or if someone made little mistakes and says "fixed the missing semi-colon", no need to record something like that.
Wouldn't really see the use in small, private projects.
 
Top
Sign up to the MyBroadband newsletter
X