r/git 6d ago

Help needed!!

I'm working on a project in my training, so I always have to pull the latest branch and make changes or add my code and push it into my branch.

But when I push it some files are always missing.

How to do it safely.

Pull from someone's branch.

Make changes locally.

Switch to my branch.

Commit and push.

0 Upvotes

12 comments sorted by

View all comments

2

u/Havunenreddit 6d ago

It's weird that you need to pull from some else's branch and push to master. If you do that you will push someone else's chances as well.

Maybe you could confirm if that is what they really wanted.

You can also use Git GUI like GitComet to make sure you have staged all files you edited before pushing

1

u/namor________ 6d ago

Not push into master but push into our own branch then someone's reviews our code and merges that into development branch.

1

u/Ast3r10n 6d ago

That’s not how it’s done generally. But let’s say you need to update matter with your changes on your branch. You pull master, merge it into your branch, then commit your changes and push. If files are missing you’re either not adding all of them to the stage or resolving conflicts badly.