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

Update adding-locally-hosted-code-to-github.md #19985

Merged
merged 13 commits into from
Aug 26, 2022
Merged

Conversation

harsh8051
Copy link
Contributor

This change is made to display a warning to reader that -b main flag does not older version of git.

Why:

Closes issue link

What's being changed

Add a warning block in adding-locally-hosted-code-to-github.md page

screencapture-github-github-docs-compare-main-harsh8051-docs-patch-2-2022-08-19-18_14_22

Check off the following:

  • [x ] I have reviewed my changes in staging (look for the "Automatically generated comment" and click the links in the "Preview" column to view your latest changes).
  • [ x] For content changes, I have completed the self-review checklist.

Writer impact (This section is for GitHub staff members only):

  • This pull request impacts the contribution experience
    • I have added the 'writer impact' label
    • I have added a description and/or a video demo of the changes below (e.g. a "before and after video")

This change is made to display a warning to reader that  ``` -b  main ``` flag  does not older version of git.
@welcome
Copy link

welcome bot commented Aug 19, 2022

Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Aug 19, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Aug 19, 2022

Automatically generated comment ℹ️

This comment is automatically generated and will be overwritten every time changes are committed to this branch.

The table contains an overview of files in the content directory that have been changed in this pull request. It's provided to make it easy to review your changes on the staging site. Please note that changes to the data directory will not show up in this table.


Content directory changes

You may find it useful to copy this table into the pull request summary. There you can edit it to share links to important articles or changes and to give a high-level overview of how the changes in your pull request support the overall goals of the pull request.

Source Preview Production What Changed
get-started/importing-your-projects-to-github/importing-source-code-to-github/adding-locally-hosted-code-to-github.md fpt
ghec
ghes@ 3.6 3.5 3.4 3.3 3.2
ghae
fpt
ghec
ghes@ 3.6 3.5 3.4 3.3 3.2
ghae

fpt: Free, Pro, Team
ghec: GitHub Enterprise Cloud
ghes: GitHub Enterprise Server
ghae: GitHub AE

@cmwilson21
Copy link
Contributor

@harsh8051 Thanks so much for opening a PR! I'll get this triaged for review ⚡

@cmwilson21 cmwilson21 added content This issue or pull request belongs to the Docs Content team waiting for review Issue/PR is waiting for a writer's review get started Content related to "Getting Started" doc set and removed triage Do not begin working on this issue until triaged by the team labels Aug 19, 2022
@TeerasakSinghnoi17

This comment was marked as resolved.

Copy link

@rohitscript rohitscript left a comment

Choose a reason for hiding this comment

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

Everything Alright

Clarified how to do this step in Git 2.27.1 and earlier.
@meowius
Copy link
Contributor

meowius commented Aug 25, 2022

@harsh8051 Thank you so much for this excellent idea! 🎉

We've consulted the team and agree it will be very helpful to clarify that the steps apply to Git 2.28.0, as well as to add another method for Git 2.27.1 and below. We'll make those suggested wording changes and get this merged for you!

@harsh8051
Copy link
Contributor Author

Thank You @cmwilson21

@harsh8051 Thanks so much for opening a PR! I'll get this triaged for review zap

@harsh8051
Copy link
Contributor Author

harsh8051 commented Aug 26, 2022

Thank You @rohitverse

Everything Alright

@harsh8051
Copy link
Contributor Author

harsh8051 commented Aug 26, 2022

Thank You @meowius for considering my opinion
Your suggestions are definitely helpful for me to learn better documentation

@harsh8051 Thank you so much for this excellent idea!

We've consulted the team and agree it will be very helpful to clarify that the steps apply to Git 2.28.0, as well as to add another method for Git 2.27.1 and below. We'll make those suggested wording changes and get this merged for you!

@harsh8051 harsh8051 closed this Aug 26, 2022
@harsh8051 harsh8051 reopened this Aug 26, 2022
@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Aug 26, 2022
@harsh8051 harsh8051 closed this Aug 26, 2022
@harsh8051 harsh8051 reopened this Aug 26, 2022
@harsh8051
Copy link
Contributor Author

should I close this PR or have to wait ?

@harsh8051 Thank you so much for this excellent idea! tada

We've consulted the team and agree it will be very helpful to clarify that the steps apply to Git 2.28.0, as well as to add another method for Git 2.27.1 and below. We'll make those suggested wording changes and get this merged for you!

@meowius
Copy link
Contributor

meowius commented Aug 26, 2022

@harsh8051 We'll go ahead and merge it shortly! Was just double-checking on preview to make sure my commit had proper formatting. Thanks so much for checking. 💖

Copy link
Contributor

@meowius meowius left a comment

Choose a reason for hiding this comment

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

Thanks again for this excellent suggestion. Have changed the warning into inline copy since we were able to find a solution for those using older versions of Git.

@meowius meowius merged commit 294aa18 into github:main Aug 26, 2022
@github-actions
Copy link
Contributor

Thanks very much for contributing! Your pull request has been merged 🎉 You should see your changes appear on the site in approximately 24 hours. If you're looking for your next contribution, check out our help wanted issues

@harsh8051
Copy link
Contributor Author

it's my pleasure mam. Thank you so much for your kind support

Thanks again for this excellent suggestion. Have changed the warning into inline copy since we were able to find a solution for those using older versions of Git.

@harsh8051
Copy link
Contributor Author

Thank you...I will definitely look for more contribution

Thanks very much for contributing! Your pull request has been merged 🎉 You should see your changes appear on the site in approximately 24 hours. If you're looking for your next contribution, check out our help wanted issues

@harsh8051
Copy link
Contributor Author

harsh8051 commented Aug 27, 2022

Hello @meowius
There is one concern about this PL
Direct execution of command git init && git branch -m main leads to error #24104 on GitHub Community

I think the reason is you can't rename branch without committing changes . As this document is about adding existing project to Github there will Untracked files . So we have to highlight this. Please consult with the team
I have tried to demonstrate what happening over here with my console

Try to initialize git repo and rename branch but failed

harshal@pop-os:/media/harshal/Disk/Vite/cssPropetyShow$ git init && git branch -m main
Initialized empty Git repository in /media/harshal/Disk/Vite/cssPropetyShow/.git/
error: refname refs/heads/master not found
fatal: Branch rename failed

Add files to staging area and rename branch but failed


harshal@pop-os:/media/harshal/Disk/Vite/cssPropetyShow$ git add .
harshal@pop-os:/media/harshal/Disk/Vite/cssPropetyShow$ git branch -m main
error: refname refs/heads/master not found

commit changes


harshal@pop-os:/media/harshal/Disk/Vite/cssPropetyShow$ git commit -m "First commit"
[master (root-commit) 5401f2d] First commit
 Committer: Harshal Kantilal Dhone <harshal@pop-os.localdomain>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:

    git config --global --edit

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 9 files changed, 198 insertions(+)
 create mode 100644 index.html
 create mode 100644 package.json
 create mode 100644 public/vite.svg
 create mode 100644 src/App.css
 create mode 100644 src/App.jsx
 create mode 100644 src/assets/react.svg
 create mode 100644 src/index.css
 create mode 100644 src/main.jsx
 create mode 100644 vite.config.js

Rename successful

harshal@pop-os:/media/harshal/Disk/Vite/cssPropetyShow$ git branch -m main
harshal@pop-os:/media/harshal/Disk/Vite/cssPropetyShow$ git branch
* main
harshal@pop-os:/media/harshal/Disk/Vite/cssPropetyShow$ 

Shall I open new issue for this or we can fix this by reopening this PL?

@meowius
Copy link
Contributor

meowius commented Aug 29, 2022

Thanks so much @harsh8051, really appreciate your taking the time to flag this and provide this detail. I'll look into this and loop back.

We can use this PR to track this work for now and then open a new PR when we have clarified the answer. Stay tuned!

@meowius
Copy link
Contributor

meowius commented Aug 29, 2022

👋 Hi again @harsh8051 – Thank you again very much for pointing out the error, it's extremely thoughtful of you to try to prevent anyone else from frustration! Here's a new idea that we hope works, may I ask you to try it and see?

In step 4 in the article, instead of:

$ git init && git branch -m main

Try:

$ git init && git symbolic-ref HEAD refs/heads/main

Per our research this should be functional to even the oldest Git versions still in use, and it doesn’t require a commit to have been made.

Would you be able to test and verify? If it does indeed work, it would be great to open a new PR.

@harsh8051
Copy link
Contributor Author

HI @meowius
Thank you for your patience and considering this again.
Yes I have tested and verified on Pop!_OS 20.04 LTS 64-bit and git version 2.25.1

harshal@pop-os:~/test$ git init && git symbolic-ref HEAD refs/heads/main
Initialized empty Git repository in /home/harshal/test/.git/
harshal@pop-os:~/test$ 
harshal@pop-os:~/test$ git status
On branch main

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	1
	sample

nothing added to commit but untracked files present (use "git add" to track)
harshal@pop-os:~/test$ 

Everything is fine. Branch Rename with untracked file
Done...

@meowius
Copy link
Contributor

meowius commented Aug 30, 2022

Excellent @harsh8051, thank you so much for trying and verifying this solution! 🎉

Please let me know if you'd be willing to open a new PR to edit this article with the new solution, or if you'd prefer that we do so!

@harsh8051
Copy link
Contributor Author

Hi @meowius
I think opening new PR will take time like different verification, resource allocation for review again.
Second thing is a GitHub docs team has come up this fast and feasible solution so I don't deserve credit for that
I prefer most efficient way for solution delivery and that will be edit by team in my thoughts.
finally if team thinks I should open a PR then I will do it anytime😊
Thanks and regards

@meowius
Copy link
Contributor

meowius commented Aug 31, 2022

I understand @harsh8051! Thanks for being so thoughtful. I'll go ahead and open a PR in our internal repo to get this fixed! 💖

@meowius
Copy link
Contributor

meowius commented Sep 6, 2022

Just letting you know @harsh8051 that this is updated on production. Thank you again for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content This issue or pull request belongs to the Docs Content team get started Content related to "Getting Started" doc set triage Do not begin working on this issue until triaged by the team waiting for review Issue/PR is waiting for a writer's review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants