Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a symbolic link across git branches?

I am working on the SO Ruby Chat rules repo. The RULES.md in master should be the same as rules.md on the gh-pages branch; however, it does not reflect changes of the latter.

I know that a symbolic link in Directory B simply points to a file in Directory A. I want to apply the same logic across branches in git.

Again, since the gh-pages branch is the main focus, I would like a symlink in master that points to gh-pages/rules.md. I have done some research and cannot find anything for this exact issue.

like image 376
onebree Avatar asked Oct 19 '22 04:10

onebree


1 Answers

The scenario you are trying to implement is not possible(sym link).

Please check the following things if you are worked or not.

  1. Modified the rules.md file in master/any other branch.
  2. Check the status using git status
  3. Add rules.md file using git add rules.md
  4. Commit your changes in git using git commit -m "message against the changes"
  5. Once this is done you want your changes to be reflect in other branches also.
  6. Move to your branch using git checkout branchname
  7. And now merge the changes that you did in master.
  8. For merging use git merge branch name

If there are no conflicts then it should merge smoothly. All your changes present in master branch reflects here.

like image 170
Abhijeet Kamble Avatar answered Oct 22 '22 01:10

Abhijeet Kamble