Skip to content

Instantly share code, notes, and snippets.

@ankitpriyarup
Last active April 19, 2024 21:10
Show Gist options
  • Save ankitpriyarup/e2056da4a08b12ff7535bffa361c92e1 to your computer and use it in GitHub Desktop.
Save ankitpriyarup/e2056da4a08b12ff7535bffa361c92e1 to your computer and use it in GitHub Desktop.
# Sync with upstream, humne branch pull kara thaa changes maare uspe par kisi aur ne uspar kaam kardiaa toh this command will sync our code with the github server. but humare changes remove kardetaa he ye
git remote add upstream /url/to/original/repo.git
git fetch upstream
git checkout master
git reset --hard upstream/master
git push origin master --force
# Squash 3 commits
# Kabhi kabhi hum jab PR daalte he toh review karne waale bolte he ki 2-3 commits ko ekk banaa do for simplicity this command does that
git reset --soft HEAD~3 && git commit
git push --force
# To delete 3 branch starting from head
git reset --hard HEAD~3
# To merge branch xyz from master, this will create another commit in xyz branch merging files
git checkout xyz
git merge master
@mrmonkey0825
Copy link

/x1000000counsblooketaQ_910262827'Aboldrzopwuex d
what
e
i hate you
![nkojj(https://gist.github.com/assets/166779994/072aa7f2-dc4e-43e7-89f2-4d53f9cfcc39)

@mrmonkey0825
Copy link

Uploading rizz.jpg…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment