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

Closes #7 #8

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

Closes #7 #8

wants to merge 6 commits into from

Conversation

somya22
Copy link

@somya22 somya22 commented Jun 14, 2020

Closes #7 Added the necessary changes in README.md

README.md Outdated
@@ -23,6 +23,20 @@ git add -A
git commit -m "Your commit message"
git push --set-upstream origin new-branch
```
The git add command lets you add a file to the staging area. You can think of the staging area as a step before the commit process in git.
Copy link
Member

Choose a reason for hiding this comment

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

you can use ' ` ' to add code snippets in a line, just like you use this '```' to add multi-line code snippets

Copy link
Member

Choose a reason for hiding this comment

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

Replacing git add with git add <file_name> would be intuitive.

As long as a changeset is in the staging area, git allows you to edit it as you like.
The git add -A command however, finds all new and updated files everywhere throughout the project and add them to the staging area.

* Inspecting a repository
Copy link
Member

Choose a reason for hiding this comment

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

Take a look at github markdown to format the text in .md files link

Copy link
Member

@tushar5526 tushar5526 Jun 14, 2020

Choose a reason for hiding this comment

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

You can format your changes using markdown :) for better readability

Copy link
Member

@tushar5526 tushar5526 left a comment

Choose a reason for hiding this comment

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

Format the changes using markdown

@tushar5526
Copy link
Member

Nice work @somya22 , can you also squash your commits into one :) then I will merge it into master branch
Read this

@somya22
Copy link
Author

somya22 commented Jun 15, 2020

@tushar5526 Hey sure. But I'm stuck somewhere. Am I supposed to do this while being on the master branch? I'm unable to exit it and apparently there's no good solution for it on the internet. Can you help me proceed?

@tushar5526
Copy link
Member

tushar5526 commented Jun 15, 2020

@somya22 can you elaborate on your problem a little, where are you stuck ?
Thanks

@somya22
Copy link
Author

somya22 commented Jun 15, 2020

@tushar5526 I am stuck on the master branch of my forked repository (Hello-World).

@tushar5526
Copy link
Member

@tushar5526 I am stuck on the master branch of my forked repository (Hello-World).

Can you tell me the last command few commands you ran? You can be stuck for a lot of reasons, if there are any error messages tell me that too.

@somya22
Copy link
Author

somya22 commented Jun 15, 2020

@tushar5526 I am stuck on the master branch of my forked repository (Hello-World).

Can you tell me the last command few commands you ran? You can be stuck for a lot of reasons, if there are any error messages tell me that too.

Sure. First of all, there is an issue with syncing my fork. The Git command line showed that it is synced and my fork on Github showed that it is 10 commits behind the original. Then, 'push origin master' gave a fatal error that “origin does not appear to be a git repository”. I made changes to my forked repo and then created a pull request later. And now, Git is stuck on the master branch.

@tushar5526
Copy link
Member

Can you drop a Screenshot of following commands
git remote -v
git status
git log --graph --oneline
or I can help you on team viewer :)

@tushar5526
Copy link
Member

Need gdrive access @somya22, you can attach the files here too, just drag and drop them.

@somya22
Copy link
Author

somya22 commented Jun 15, 2020

unnamed
pasted image 0

pasted image 0 (1)

@tushar5526
Copy link
Member

tushar5526 commented Jun 15, 2020

@somya22 git remote -v gives only upstream URL ( or the main repository from where you have forked the project ). There is no URL to your forked repository, so git push command tries pushing to TheCodesis/hello-world and you don't have permissions to do so.

Do this : git remote add origin <you forked repo URL>
This adds a link to you forked repo in an alias origin
Now to push git push origin <your-branch-name>, in this case you are working from master so,
git push origin master

I think you did some mistakes syncing your fork !
You can learn more about git and github through GitHub Learning Lab ( link in discord channel or google it )

@tushar5526
Copy link
Member

Feel free to ask, if I was not clear enough :)

@somya22
Copy link
Author

somya22 commented Jun 15, 2020

@tushar5526 Thankyou I'll look into it.

@somya22
Copy link
Author

somya22 commented Jun 15, 2020

@tushar5526 Here's the problem. Acc to git status, changes are up to date and still, the rebase command is saying that the changes are unstaged.

pasted image 0 (2)
.

@tushar5526
Copy link
Member

tushar5526 commented Jun 16, 2020

Follow this
git reset is what you need to reset the files
then add the files you changed
Then

git rebase -i HEAD~4

change the last three pick to squash, then save it using

Ctrl + O
Enter Key
Ctrl + X

Then modify the commit messages and force push the branch back to github

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 somya22/some-relevant-name. If you make PRs from the master branch, you won't be able to work on multiple issues simultaneously.

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.

Provide Explanation for git add -A in README.md
3 participants