|
Here's the skinny.
Git Local Repo On Windows
1. Get Git Bash at : https://git-scm.com/downloads
[^]
Yes, this is official git.
2. After installing, you open a Git Bash console window.
3. Navigate to your main project directory and type
c:\MainProject>git init
EDIT -- navigating there in git bash a bit different... it'll be like <code> cd /c/MainProject/ a bit different if you're accustomed to DOS/Windows. It's case sensitive.
4. That creates a repo.
5. copy the following .gitignore for Visual Studio (and WPF)[^] and create a text file in c:\MainProject> directory named .gitignore and save that text. This will create an ignore file so that git will ignore the stuff that shouldn't be in the repo.
6. Run
c:\MainProject>git add . (git add dot) This will add all of the correct files (including the .gitignore) to your repo for tracking.
7.
c:\MainProject> git commit -a -m "This is the initial commit for this project"
Commits the files the first time. Now your changes will be tracked.
8. Next time you change a source file, try
c:\MainProject\>git status
that will show you the files that have been changed.
9. Then do
c:\MainProject>git diff
Will show you changes in the file
Git bash is like linux bash running in windows so ls -al etc works.
Git Remote
Sign up for GitHub account at GitHub.com and then there are some commands you can use to push your changes up. A little more details than can be added here, but very cool. You can keep everything in alignment no matter what machine you are working on.
|
|
|
|
|
Back when I used SVN it VS also didn't like projects from different repos. Only once would show the icons. I think VS Code might support multiple repos.
We use VSTS / Azure devops to host our repos. There are free ones like Github and Gitlab. There's probably an easier way, but I create the repo on there (online), then use the command line to clone it locally and
then work with a ui from there. Check out Atlassian's tutorial on Gitflow, it's nice when the project gets bigger or multiple people work on it.
|
|
|
|
|
|
I'd go for either GitHub or Azure DevOps (the cloud version of TFS), depending on what you want to do with it in the future.
GitLab is a good platform too, but not as popular as GitHub.
All three have a free plan with (unlimited) private repositories.
GitHub is easy to set up, just create an account and they'll give you a five minute tutorial on how to clone, commit and push.
If you want to use CI/CD in the future, all three platforms are still good to go.
Azure DevOps is probably easiest with .NET integration because it's a 100% Microsoft platform.
It should be easy to use GitHub for source control and Azure DevOps for CI/CD, should you want that.
Migrating complete Git repositories later shouldn't be too difficult either.
One warning though, with Git you always checkout everything.
With SVN you could have one giant repository and only checkout specific folders, not so in Git.
So it's recommended to keep repositories small and not, like you seem to want, keep different solutions in a single repository.
Git is quite different than SVN, so keep that in mind.
|
|
|
|
|
The recent Git versions are developing the Sparse checkout capability.
This is being developed actively by the Microsoft team to cope with their "world's largest repository" The largest Git repo on the planet | Brian Harry's Blog[^] problem.
Certain aspects of Git can be daunting or surprising for a while because of its distributed capability. It doesn't 'control' rather it 'verifies' content, allowing devs to actually keep lots of rough drafts and interim versions without polluting the 'official' version (the devs polish their contribution that then is accepted...).
For normal code repos, the whole repo with all history is typically less that twice the size of the basic checkout (e.g. whole of Linux history..)
A nice blog with some good graphics π³π CS Visualized: Useful Git Commands - DEV Community π©βπ»π¨βπ»[^]
|
|
|
|
|
PhilipOakley wrote: to cope with their "world's largest repository" Yeah, as I said, avoid large repositories
That was the feature I missed most when going from SVN to Git though.
By now, I'm used to it and my way of thinking about code has shifted.
I've written quite a lot about Git and I usually warn for how it looks like SVN, but works completely different.
When I went from SVN to Git things were not so good.
It was like SVN with extra steps that were more often confusing rather than not.
That was about five years ago and I know some of my former team ehhh... "mates" still struggle with Git.
By now I love it though, especially how easy it is to branch and merge code, especially with pull requests and code reviews.
|
|
|
|
|
Learn git - it will be worth the effort.
There's an interactive tutorial here:
https://learngitbranching.js.org/
You'll be able to use it locally for projects you just want history for, and you'll be able to easily upload to GitHub. Modern TFS instances are using git for version control because the old engine was so crap. Git won the vcs wars - might as well embrace it.
GitKraken is also quite a good gui client, though I tend to stick to the cli and only use a gui client for viewing history on files - and then it's most convenient to use the inbuilt client in webstorm and rider.
If you say that getting the money is the most important thing
You will spend your life completely wasting your time
You will be doing things you don't like doing
In order to go on living
That is, to go on doing things you don't like doing
Which is stupid.
|
|
|
|
|
When I have to use GIT (which is becoming most of the time now), I use SourceTree - the GUI Front End that makes it a little easier. I usually break something, so I have to call in a GIT expert and they fix it all up (GIT experts love fixing GIT problems). So, yeah, if you use GIT, git yourself SourceTree. Then, git yourself a GIT expert.
|
|
|
|
|
|
Git is now my preferred way of doing source code control. But the learning curve is ridiculously steep. If you have to get it together in a week, I'd say use Tortoise SVN or something.
|
|
|
|
|
I know a great joke about the Corona Virus; however, you probably won't get it.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Not so sure about that - it has appeared in most countries in the world.
Of course China got it right off the bat...
If you can't laugh at yourself - ask me and I will do it for you.
|
|
|
|
|
|
Apparently, McAfee have released a CoronaVirus update: You copy it onto a USB stick, insert it in your a$$ and let it do it's thing.
I suspect the cure will be worse than the disease though.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Depends on where you are; 3rd world places like New York your odds are better!
When you talk, you are only repeating what you already know.
But if you listen, you may learn something new.
--Dalai Lama
JaxCoder.com
|
|
|
|
|
Quote: 3rd world places like New York What has the 3rd world ever done to you, that you have to insult it like this?
Get me coffee and no one gets hurt!
|
|
|
|
|
Sorry didn't mean to insult.
When you talk, you are only repeating what you already know.
But if you listen, you may learn something new.
--Dalai Lama
JaxCoder.com
|
|
|
|
|
I noticed he hadn't been snarking at Insider messages lately, and when I looked at his account; it's showing disabled. I was a bit surprised by that; while I often disagreed with what he wrote, I don't recall ever seeing that approached let alone crossed the line into deserving administrative action. Which leaves me wondering if he had a bad day and posted something really stupid that got promptly nuked off the site before I saw it, or did he realize he needed to take a break and asked to have his account suspended because he lacked the willpower to stay away on his own. (I've seen several people do this elsewhere.)
Edit: Please don't regurgitate any embarrassing details.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on oneβs own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
modified 28-Apr-20 11:32am.
|
|
|
|
|
We've temporarily timed out his account.
Thanks,
Sean Ewington
CodeProject
|
|
|
|
|
Fair enough.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on oneβs own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
So you've sent him to the Naughty Step?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I also noticed this when I wondered why he wasn't sniping at Windows-related posts on the Insider News.
He has sometimes pushed the envelope on political content and can get a bit vituperative, but I don't know what happened specifically.
|
|
|
|
|
Dan Neely wrote: Please don't regurgitate any embarrassing details. Something about a pineapple, a squirrel, and a toilet. That's all I can say.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Dan Neely wrote: I noticed he hadn't been snarking at Insider messages lately That's going to affect my life a lot.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Can an hour of yoga seem like a long stretch?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|