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

added hello world #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

added hello world #6

wants to merge 4 commits into from

Conversation

paridhigulati
Copy link

No description provided.

@tushar5526
Copy link
Member

Nice work @paridhigulati, I think you have made two cpp files for hello world and git add -A adds all the files to staging area ( or include it to the list of files that will be commited )

To add individual files you can use git add <your-file-name> and then usegit status to check which files are included in staging area and which branch are you working in !

Also we never use master branch to submit a Pull Request, we always make a new branch , read this

You can try fixing this PR or make a new one as per your wish ( and don't forget to add your name in Contributors.md )

@tushar5526
Copy link
Member

Nice @paridhigulati, let's do one more thing, Read this
This will squash your four commits into one, and keep our project's history clean and simple

Copy link
Member

@adiaholic adiaholic left a comment

Choose a reason for hiding this comment

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

Never use your master branch to push features. Instead you should make a branch on your fork: eg paridhigulati/some-relevant-name. If you make PRs from the master branch, you won't be able to work on multiple issues simultaneously.

@paridhigulati
Copy link
Author

@adiaholic Oh sorry, I didn't know this.
I did use git checkout -b new-branch but I guess it didn't work.
Is there a way I could delete all the commits and do this all over again properly?

@tushar5526
Copy link
Member

Yes, you can switch to a new branch and then squash your commits into one. Any other way do you prefer @adiaholic ?

@adiaholic
Copy link
Member

@paridhigulati Sadly, there isn't a way to rename a branch. What you need to do is,

  1. Make another branch with correct branch-name.
  2. Instead of re-committing changes, rebase the newer branch on this branch. This will reflect those changes automatically.

@CapTen101
Copy link
Member

CapTen101 commented Jun 20, 2020

@adiaholic Acually there is apparently a way to rename branches: git branch -m <old name> <new name> or if we want to just rename the current branch then simply git branch -m <new name>

I think what you meant there is that we cannot of course rename master to some other name

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.

4 participants