-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Practice: conflict
- Create
feat/conflictbranch at local and createconflict/Conflict.javafile 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));
}
}- Commit and push to your forked repository
$ git add .
$ git commit -m "feat: conflict commit"
$ git push <YOUR_ID> feat/conflict-
Make PR, then you can check conflict.
feat/conflict_base◀️ feat/conflict -
Merge
feat/conflict_baseat local
$ git merge origin feat/conflict_base- 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));
}
}- Push commit to
feat/conflict
$ git add .
$ git commit -m "fix: resolve conflict"
$ git push <YOUR_ID> feat/conflictMetadata
Metadata
Assignees
Labels
No labels
