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

feat-#378: created readme for git conflicts #412

Closed

Conversation

rushil-b-patel
Copy link
Contributor

Summary

A readme file for the common git conflicts that contributors face while contribting in open source.

Description

Created a readme file (GIT_CONFLICTS) in the root folder which includes common Q&A.

Issue(s) Addressed

Closes #378

Prerequisites

Copy link

vercel bot commented Jun 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wanderlust ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 25, 2024 11:51am
wanderlust-backend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 25, 2024 11:51am

Copy link

github-actions bot commented Jun 9, 2024

Hey @rushil-b-patel! Thanks for sticking to the guidelines! High five! 🙌🏻

Copy link
Owner

@krishnaacharyaa krishnaacharyaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we first aim on only 2 dropdown points?

  1. How to hard sync local master with original upstream?
  2. Why am i seeing previous commit messages in my new branch?

Just like bullet points and a very nice image illustration as i shared would be really helpful, I guess you can generate it via chatgpt or in some blogs, you can put it neatly

GIT_CONFLICTS.md Outdated
# Wanderlust Project

## Overview
Welcome to the Wanderlust project! This is a collaborative effort to build an amazing application. We appreciate your contributions and aim to make the process as smooth as possible.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly remove this section

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

GIT_CONFLICTS.md Show resolved Hide resolved
GIT_CONFLICTS.md Show resolved Hide resolved
GIT_CONFLICTS.md Show resolved Hide resolved
GIT_CONFLICTS.md Outdated
## Better commits

You should not push what is not needed. Doing **`git commit -a`**, instead, commits just everything. This, often, is bad.
You’d better use **`git add`** and, most of all, **`git add -p`**
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are in 3 sec world, people can't hold their eyes more than 3 seconds, to convince them to read, we have to keep it in simple bullet points

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

GIT_CONFLICTS.md Show resolved Hide resolved
@rushil-b-patel
Copy link
Contributor Author

Hey @krishnaacharyaa sorry for the late response. I have made some changes with the help of co-pilot. Please review.

@krishnaacharyaa
Copy link
Owner

As Discussed in discord @rushil-b-patel

Copy link
Owner

@krishnaacharyaa krishnaacharyaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rushil-b-patel kindly acknowledge the review comments, expecting ownership of this bug

GIT_CONFLICTS.md Show resolved Hide resolved
GIT_CONFLICTS.md Outdated
To hard sync your local master branch with the upstream master branch, follow these steps in your main branch:

- `git remote add upstream /url-to-original-repo`
- `git fetch upstream`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can say it directly taken from the AI and not tested, how can /url-to-original-rep work?
Acceptance criteria was everthing should be tested and working, and for now only 2 points we need to have as previous review comment

</details>

## Better commits

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually need this?

GIT_CONFLICTS.md Outdated
<details>
<summary>
<em>What should I do if I’m in a bad situation?</em>
</summary>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment, kindly consider the review comment as whole, and don't expect me to hand hold and to pin point everything, I am not rigid on the content, but i accept the review comments are gracefully accepted and worked on

@krishnaacharyaa
Copy link
Owner

Closing as no inactive

@rushil-b-patel
Copy link
Contributor Author

hey @krishnaacharyaa I'm sorry, I have been into placement stuff and getting time for this. But Please give me 2-3 days. I'll do it.
I hope you understand.

@krishnaacharyaa
Copy link
Owner

Sure @rushil-b-patel , all the best for your placements, Hope you get the best !!
I'm fine waiting tbh, but I was not able to see the interest in contributing, rather just to complete this for the sake of it...
So had to close,
Hope you get my perspective,
If you come back with enthusiasm and actually contributing, happy to re-open this and guiding ...!

@rushil-b-patel
Copy link
Contributor Author

sure @krishnaacharyaa , I'll get back to it...
Thanks

@krishnaacharyaa
Copy link
Owner

@rushil-b-patel

Copy link
Owner

@krishnaacharyaa krishnaacharyaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the efforts, but I feel it would be better, If you pick other existing stories, tbh, I don't see we mutually getting benefit of the conversation we are having. respectfully.

Follow this while creating new branch and commiting changes:
```sh
- git checkout main/master
- git branch -b new_branch
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll get error message when I run 60th line

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And kindly add the sync command as well



1. Convenient way to modify the most recent commit
```sh
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

People usually don't do this, instead if we have 3rd main point as squashing of commit into new commit that would be great

<details>
<summary>
<em>Edit a commit</em>
</summary>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is actually required, this section

```
2. Using git reset
```sh
git add .
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This naively thinks nothing is pushed, original scenario may be still worse, I have pushed my commit already now what should I do?

```

3. To undo the last two commits, use the commands:
```sh
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be avoided, as we don't normally end up here very often and again pushed commits it doesn't address

for more info refer this [blog](https://sentry.io/answers/undo-the-most-recent-local-git-commits/)

4. Change the last commit message
```sh
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, this is the commit which is not pushed.

<details>
<summary>
<em>Good Practice</em>
</summary>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Included already in the readme and this is FnQ, not a good place for good practice,
Only most popular trick GitHub questions and neatly providing suggestions to solve that

git commit --amend -m "New commit message"
```
![git ammend showcase](https://github.com/rushil-b-patel/wanderlust/assets/96254453/4c5e73b1-e466-42b4-9053-d7044be4a50e)
for more info, watch this [video](https://www.youtube.com/watch?v=q53umU5vMkk)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have already said not to use this types of images :)

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 this pull request may close these issues.

[FEATURE] Common QnA for Git Conflicts
2 participants