❔ 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
he has this
and I'm not exactly sure how to merge it with mine
Is there a lot of duplicate code or are these separate codebases being merged?
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
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. 🙂I'll just say "that's why you use Github"
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
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.
Or let your partner deal with this mess, since it seems like they're the one who caused it
They haven’t been answering my messages since Wednesday.
Doesn't sound like they care much. 🤷♂️
Are you doing this for school or something?
So it’s kinda all on me
Yes
He comes out when it affects his grade
Maybe speak with your professor? You're kinda stuck between two problems right now. Fix the IRL one first 😄
But disappears for everything else
She already given me two been dealing with this for days
And my original final got corrupted
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
It kinda
Erased I don’t have it
In the IDE or on your filesystem?
File system
Thankfully I saved the RAW text on my google drive but
I had to do everything from scratch
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.
Now I’m just taking what he’s done and trying to make it work
And, for all that is holy, use version control
Not to mention my other group mate
Didn’t give us his part until 11:40 PM the day the project was due
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. 🙂
my best
$git
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
uh, that's a lot
$gitstarted
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 thisWoah yeah LMAO
i'm having issues bringing in the files
<__>
How so?
im copying pasting what he's done
but it's not coming on
like its not pasting
Are you copying code snippets or files into the directory?
the files he attached
this
Open the csproj and include the files
lemme find it
didnt work 3:
How are you trying? 😁
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
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.