Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Practice: conflict #7

Open
yeonns opened this issue Mar 19, 2023 · 0 comments
Open

Practice: conflict #7

yeonns opened this issue Mar 19, 2023 · 0 comments

Comments

@yeonns
Copy link
Owner

yeonns commented Mar 19, 2023

Practice: conflict

  1. Create feat/conflict branch at local and create conflict/Conflict.java file like below.
public class Conflict {

    public static Integer getLength(String str) {
        return str.length();
    }

    public static void main(String[] args) {
        String s1 = "hello";
        System.out.println("hello's length: " + getLength(s1));
    }
}
  1. Commit and push to your forked repository
$ git add .
$ git commit -m "feat: conflict commit"
$ git push <YOUR_ID> feat/conflict
  1. Make PR, then you can check conflict.
    feat/conflict_base ◀️ feat/conflict

  2. Merge feat/conflict_base at local

$ git merge origin feat/conflict_base
  1. Resolve conflict like below
package conflict;

public class Conflict {

    public static Integer getLength(String str) {
        return str.length();
    }

    public static void main(String[] args) {
        String s1 = "hello";
        String s2 = "world";
        System.out.println("hello world's length: " + getLength(s1));
    }
}
  1. Push commit to feat/conflict
$ git add .
$ git commit -m "fix: resolve conflict"
$ git push <YOUR_ID> feat/conflict
  1. Result should be like below!
    image
@yeonns yeonns linked a pull request Mar 19, 2023 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant