Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9225531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:36:00+00:00 2026-06-18T04:36:00+00:00

Assume I have a class. package org.my.domain; public class BestClassEver{} My Workflow Through some

  • 0

Assume I have a class.

package org.my.domain;

public class BestClassEver{}

My Workflow

Through some refactoring, I change this class’s package.

package org.another.domain;

public class BestClassEver{}

I commit this to my local repository using git and push it to a remote repository.

git add .
git commit -m "Refactoring"
git push origin master

Another Developer’s Workflow

Another developer modifies the class, without pulling my changes.

package org.my.domain;

public class BestClassEver{
    private String something;
}

Then commits and pushes to the remote repository

git add .
git commit -m "Some Changes"
git push origin master

Questions

  1. Will Git merge the other developer’s changes into the class?
  2. If not, what happens?
  3. Is this workflow something that needs to be coordinated amongst the team?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:36:01+00:00Added an answer on June 18, 2026 at 4:36 am
    1. Git won’t allow the other developer to push his changes without pulling.

    It will throw an error that both refs don’t match and therefore his local branch needs to be updated with the remote refs.

    That’s pretty much all there is to know about that. If there are changes in the remote repository, unless you do a forced push, git won’t allow you to push changes if there are changes in the remote.

    EDIT

    Once he pulls, if there are any conflicts in the file, the developer will have to correct any conflicts, commit them and only then he will be able to push.

    If there are no conflicts, git will automatically merge those changes and the developer will be able to push after the pull.

    EDIT AGAIN

    I didn’t realize that you were moving the file. In any case, running git status would give you an idea as to the state of your local repository after a pull. If there was any conflicts, you’d be able to correct them.

    NOTE

    On git rebase or git pull --rebase are usually used to give you a much cleaner commit history as they will pretty much will apply any local changes on top of any other changes that were pulled.

    On the other hand, git pull and git merge will usually make an extra commit to link the changes on the branches.

    For more information take a look at this guide Git Rebasing

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assume I have a class that looks like this: class Sample { public string
Assume I have a C# class like this: [XmlRoot(floors)] public class FloorCollection { [XmlElement(floor)]
Assume I have a class class A { char *attr1,*attr2; public: . . .
Assume I have this model : class Task(models.Model): title = models.CharField() Now I would
I have the following Model class: package com.swaranga.model; public final class Book { private
Let's assume I have a file named Main.java with the following code: public class
Assume the following trivial class: package Sample; public class Status { private Long id;
assume we have : class Dictionary { int n; int *ints; char **strs; inline
Lets assume we have a class car. How would You name parameters of function
So let's assume I have a class named ABC that will have a list

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.