C
C#2y ago
Jules

❔ Merging two projects together

Gotta merge two projects together but the issue is some of my partners code is running errors when it's on mine and he has datasets on his that I'm not exactly sure how to bring over.
43 Replies
Jules
JulesOP2y ago
he has this
Jules
JulesOP2y ago
Jules
JulesOP2y ago
and I'm not exactly sure how to merge it with mine
Amos
Amos2y ago
Is there a lot of duplicate code or are these separate codebases being merged?
Jules
JulesOP2y ago
So he left my code and decided to make a whole new one for me to put into my code So it’s two separate for right now Last time I merged it with mine, my entire file got corrupted, and I had to build it from scratch
Amos
Amos2y ago
There's plenty of ways to do it, I think. You could move your Main() functions into their own respective classes or new methods then just call the new methods in the single entry point. You could also have two separate projects under your main project .sln (the easiest way) When you accidently corrupted it before, it's likely just that the file references got messed up in the csproj file(s). You can amend the paths manually and this would have likely fixed it. (This is my assumption of what happened since I've experienced it before) Just a disclaimer; I'm relatively new to C#. There will absolutely be someone else here with the more appropriate knowledge who'll be able to help better. 🙂
Angius
Angius2y ago
I'll just say "that's why you use Github"
Jules
JulesOP2y ago
Cause we have to carry the designs too Last time I just dragged and dropped what they did and tried doing it from the ground up to build it But that’s when the corruption happened We aren’t even supposed to have the databases Or entity framework
Amos
Amos2y ago
I'd suggest as ZZZ said, get a GitHub setup with you two as the contributors then maybe start a new project and manually merge the codebases slowly. It's a little painful depending on the project size, but this would be the solution going forward. At least, a more permanent one.
Angius
Angius2y ago
Or let your partner deal with this mess, since it seems like they're the one who caused it
Jules
JulesOP2y ago
They haven’t been answering my messages since Wednesday.
Amos
Amos2y ago
Doesn't sound like they care much. 🤷‍♂️
Jules
JulesOP2y ago
Amos
Amos2y ago
Are you doing this for school or something?
Jules
JulesOP2y ago
So it’s kinda all on me Yes He comes out when it affects his grade
Amos
Amos2y ago
Maybe speak with your professor? You're kinda stuck between two problems right now. Fix the IRL one first 😄
Jules
JulesOP2y ago
But disappears for everything else She already given me two capooSweat been dealing with this for days And my original final got corrupted
Amos
Amos2y ago
Go and explain to them in full what the problem is. If you have the original, I'd be willing to help you restore it if you want? Assuming, it's not like data-corrupted
Jules
JulesOP2y ago
It kinda Erased yipee I don’t have it
Amos
Amos2y ago
In the IDE or on your filesystem?
Jules
JulesOP2y ago
File system Thankfully I saved the RAW text on my google drive but I had to do everything from scratch
Amos
Amos2y ago
Eh. Honestly, your best bet is to explain the problems to your professor and try and get something done. No point losing a grade or whatever due to being unable to finish a project.
Jules
JulesOP2y ago
Now I’m just taking what he’s done and trying to make it work
Angius
Angius2y ago
And, for all that is holy, use version control
Jules
JulesOP2y ago
Not to mention my other group mate Didn’t give us his part until 11:40 PM the day the project was due
Amos
Amos2y ago
Yep - you can't erase something, unless you do something absolutely wacky, that's uploaded to some version control. So no mistakes like corrupted project. 🙂
Jules
JulesOP2y ago
stressedSmoking my best
Angius
Angius2y ago
$git
MODiX
MODiX2y ago
Git commands Cheat Sheet Initialize a new qit repository: git init Set configuration values for your username and email: git config --global user.name <your-name> git config --global user.email <your-email> Clone a repository: git clone <repository-url> Add a file to the staging area: git add <file> Add all files changes to the staging area: git add . Check the unstaged changes: git diff Commit the staged changes: git commit -m "Message" Reset staging area to the last commit: git reset Check the state of the working directory and the staging area: git status Remove a file from the index and working directory: git rm ‹file> List the commit history: git log Check the metadata and content changes of the commit: git show <commit-hash> Lists all local branches: git branch Create a new branch: git switch -c <branch-name> git branch <branch-name> Rename the current branch: git branch -m <new-branch-name> Delete a branch: git branch -d <branch-name> Switch to another branch: git switch <branch-name> git checkout <branch-name> Merge specified branch into the current branch: git merge <branch-name> Create a new connection to a remote repository: git remote add <name> <repository-url> Push the committed changes to a remote repository: git push <remote> <branch> Download the content from a remote repository: git pull <remote> Cleanup unnecessary files and optimize the local repository: git gc Temporarily remove uncommitted changes and save them for later use: git stash Reapply previously stashed changes git stash apply
Angius
Angius2y ago
uh, that's a lot $gitstarted
MODiX
MODiX2y ago
git init initializes the repository dotnet new gitignore adds a .gitignore file git add . starts tracking all files git commit -m "[message]" creates a commit git remote add origin [url] adds a remote repository git push -u origin main first push, sets the remote as upstream git push all pushes after that can be just this
Jules
JulesOP2y ago
Woah yeah LMAO i'm having issues bringing in the files <__>
Amos
Amos2y ago
How so?
Jules
JulesOP2y ago
im copying pasting what he's done but it's not coming on like its not pasting
Amos
Amos2y ago
Are you copying code snippets or files into the directory?
Jules
JulesOP2y ago
the files he attached
Jules
JulesOP2y ago
Jules
JulesOP2y ago
this
Amos
Amos2y ago
Open the csproj and include the files
Jules
JulesOP2y ago
lemme find it didnt work 3:
Amos
Amos2y ago
How are you trying? 😁
Jules
JulesOP2y ago
im typing in the code and it's not working correctly it says there theres build errors but it doesnt show anything is wrong found it
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server